From ac4e7dc5d504f6d2fc075b0f4b97c1ecbc419a8b Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 4 Feb 2010 09:18:00 +0000 Subject: [PATCH] * adjust the funcname name, change findById to getById. --- trunk/module/bug/lang/zh-cn.php | 3 --- trunk/module/product/model.php | 2 +- trunk/module/productplan/control.php | 2 +- trunk/module/project/control.php | 12 ++++++------ trunk/module/project/model.php | 4 ++-- trunk/module/release/control.php | 2 +- trunk/module/task/control.php | 10 +++++----- trunk/module/task/model.php | 4 ++-- trunk/module/testcase/lang/zh-cn.php | 3 --- trunk/module/todo/control.php | 6 +++--- trunk/module/todo/model.php | 2 +- trunk/module/tree/control.php | 4 ++-- 12 files changed, 24 insertions(+), 30 deletions(-) diff --git a/trunk/module/bug/lang/zh-cn.php b/trunk/module/bug/lang/zh-cn.php index 5122480c25..60d3d767ec 100644 --- a/trunk/module/bug/lang/zh-cn.php +++ b/trunk/module/bug/lang/zh-cn.php @@ -160,9 +160,6 @@ $lang->bug->lastEditedDate = '最后修改日期'; $lang->bug->linkBug = '相关Bug'; $lang->bug->case = '相关用例'; $lang->bug->files = '附件'; -$lang->bug->field1 = 'field1'; -$lang->bug->field2 = 'field2'; -$lang->bug->feild3 = 'feild3'; $lang->bug->tblStep = "[步骤]\n"; $lang->bug->tblResult = "[结果]\n"; diff --git a/trunk/module/product/model.php b/trunk/module/product/model.php index 0a44d742d5..8fbf263eeb 100644 --- a/trunk/module/product/model.php +++ b/trunk/module/product/model.php @@ -40,7 +40,7 @@ class productModel extends model } /* ͨIDȡƷϢ*/ - public function findByID($productID) + public function getById($productID) { return $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch(); } diff --git a/trunk/module/productplan/control.php b/trunk/module/productplan/control.php index 80d752323c..9c173e116c 100644 --- a/trunk/module/productplan/control.php +++ b/trunk/module/productplan/control.php @@ -27,7 +27,7 @@ class productplan extends control public function commonAction($productID) { $this->loadModel('product'); - $this->view->product = $this->product->findByID($productID); + $this->view->product = $this->product->getById($productID); $this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$this->view->product->id}"), $this->view->product->name); $this->product->setMenu($this->product->getPairs(), $productID); } diff --git a/trunk/module/project/control.php b/trunk/module/project/control.php index ad53082776..7b4d1e39b5 100644 --- a/trunk/module/project/control.php +++ b/trunk/module/project/control.php @@ -54,7 +54,7 @@ class project extends control /* 获取当前项目的详细信息,相关产品,子项目以及团队成员。*/ $projectID = common::saveProjectState($projectID, array_keys($this->projects)); - $project = $this->project->findByID($projectID); + $project = $this->project->getById($projectID); $products = $this->project->getProducts($project->id); $childProjects = $this->project->getChildProjects($project->id); $teamMembers = $this->project->getTeamMembers($project->id); @@ -290,7 +290,7 @@ class project extends control $this->project->setMenu($this->projects, $projectID); $projects = array('' => '') + $this->projects; - $project = $this->project->findById($projectID); + $project = $this->project->getById($projectID); /* 从列表中删除当前项目。*/ unset($projects[$projectID]); @@ -351,7 +351,7 @@ class project extends control } $this->loadModel('product'); - $project = $this->project->findById($projectID); + $project = $this->project->getById($projectID); /* 设置菜单。*/ $this->project->setMenu($this->projects, $project->id); @@ -383,7 +383,7 @@ class project extends control $this->project->updateChilds($projectID); die(js::locate($browseProjectLink)); } - $project = $this->project->findById($projectID); + $project = $this->project->getById($projectID); $projects = $this->projects; unset($projects[$projectID]); unset($projects[$project->parent]); @@ -420,7 +420,7 @@ class project extends control } $this->loadModel('user'); - $project = $this->project->findById($projectID); + $project = $this->project->getById($projectID); $users = $this->user->getPairs('noclosed'); $users = array('' => '') + $users; $members = $this->project->getTeamMembers($projectID); @@ -460,7 +460,7 @@ class project extends control public function linkStory($projectID = 0) { /* 获得项目和相关产品信息。如果没有相关产品,则跳转到产品关联页面。*/ - $project = $this->project->findById($projectID); + $project = $this->project->getById($projectID); $products = $this->project->getProducts($projectID); $browseLink = $this->createLink('project', 'story', "projectID=$projectID"); diff --git a/trunk/module/project/model.php b/trunk/module/project/model.php index b7c566dbcc..04784551e3 100644 --- a/trunk/module/project/model.php +++ b/trunk/module/project/model.php @@ -110,7 +110,7 @@ class projectModel extends model } /* 通过Id获取项目信息。*/ - public function findById($projectID) + public function getById($projectID) { $project = $this->dao->findById((int)$projectID)->from(TABLE_PROJECT)->fetch(); $total = $this->dao->select('SUM(estimate) AS totalEstimate, SUM(consumed) AS totalConsumed, SUM(`left`) AS totalLeft')->from(TABLE_TASK)->where('project')->eq((int)$projectID)->andWhere('status')->ne('cancel')->fetch(); @@ -244,7 +244,7 @@ class projectModel extends model /* 燃烧图所需要的数据。*/ public function getBurnData($projectID = 0) { - $project = $this->findById($projectID); + $project = $this->getById($projectID); $sql = $this->dao->select('date AS name, `left` AS value')->from(TABLE_BURN)->where('project')->eq((int)$projectID); /* 没有指定结束日期的情况。*/ diff --git a/trunk/module/release/control.php b/trunk/module/release/control.php index adb9cdfdeb..952e126fe2 100644 --- a/trunk/module/release/control.php +++ b/trunk/module/release/control.php @@ -27,7 +27,7 @@ class release extends control public function commonAction($productID) { $this->loadModel('product'); - $this->view->product = $this->product->findByID($productID); + $this->view->product = $this->product->getById($productID); $this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$this->view->product->id}"), $this->view->product->name); $this->product->setMenu($this->product->getPairs(), $productID); } diff --git a/trunk/module/task/control.php b/trunk/module/task/control.php index 0beafe671b..3366e655be 100644 --- a/trunk/module/task/control.php +++ b/trunk/module/task/control.php @@ -34,7 +34,7 @@ class task extends control /* 添加任务。*/ public function create($projectID = 0, $storyID = 0) { - $project = $this->project->findById($projectID); + $project = $this->project->getById($projectID); $browseProjectLink = $this->createLink('project', 'browse', "projectID=$projectID&tab=task"); /* 设置菜单。*/ @@ -95,8 +95,8 @@ class task extends control /* 编辑任务。*/ public function edit($taskID) { - $task = $this->task->findByID($taskID); - $project = $this->project->findByID($task->project); + $task = $this->task->getById($taskID); + $project = $this->project->getById($task->project); /* 设置菜单。*/ $this->project->setMenu($this->project->getPairs(), $project->id); @@ -135,8 +135,8 @@ class task extends control public function view($taskID) { $this->loadModel('action'); - $task = $this->task->findByID($taskID); - $project = $this->project->findByID($task->project); + $task = $this->task->getById($taskID); + $project = $this->project->getById($task->project); /* 设置菜单。*/ $this->project->setMenu($this->project->getPairs(), $project->id); diff --git a/trunk/module/task/model.php b/trunk/module/task/model.php index d14633ceb4..bb8c2b1636 100644 --- a/trunk/module/task/model.php +++ b/trunk/module/task/model.php @@ -52,7 +52,7 @@ class taskModel extends model /* 更新一个任务。*/ public function update($taskID) { - $oldTask = $this->findByID($taskID); + $oldTask = $this->getById($taskID); $task = fixer::input('post') ->striptags('name') ->specialChars('desc') @@ -79,7 +79,7 @@ class taskModel extends model } /* 通过id获取一个任务信息。*/ - public function findByID($taskID) + public function getById($taskID) { return $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t3.realname AS ownerRealName') ->from(TABLE_TASK)->alias('t1') diff --git a/trunk/module/testcase/lang/zh-cn.php b/trunk/module/testcase/lang/zh-cn.php index 3ebb4f1069..6c6b06a158 100644 --- a/trunk/module/testcase/lang/zh-cn.php +++ b/trunk/module/testcase/lang/zh-cn.php @@ -36,9 +36,6 @@ $lang->testcase->openedBy = '由谁创建 '; $lang->testcase->openedDate = '创建日期'; $lang->testcase->lastEditedBy = '最后修改者'; $lang->testcase->lastEditedDate = '最后修改日期'; -$lang->testcase->field1 = '字段一'; -$lang->testcase->field2 = '字段二'; -$lang->testcase->feidl3 = '字段三'; $lang->testcase->version = '用例版本'; $lang->testcase->result = '测试结果'; $lang->testcase->real = '实际情况'; diff --git a/trunk/module/todo/control.php b/trunk/module/todo/control.php index 90e239e006..3f48607845 100644 --- a/trunk/module/todo/control.php +++ b/trunk/module/todo/control.php @@ -67,7 +67,7 @@ class todo extends control } /* 获取todo信息,判断是否是私人事务。*/ - $todo = $this->todo->findById($todoID); + $todo = $this->todo->getById($todoID); if($todo->private and $this->app->user->account != $todo->account) die('private'); $header['title'] = $this->lang->my->common . $this->lang->colon . $this->lang->todo->edit; @@ -84,7 +84,7 @@ class todo extends control /* 查看todo。*/ public function view($todoID) { - $todo = $this->todo->findById($todoID); + $todo = $this->todo->getById($todoID); $this->lang->todo->menu = $this->lang->user->menu; $this->loadModel('user')->setMenu($this->user->getPairs(), $todo->account); $this->lang->set('menugroup.todo', 'company'); @@ -107,7 +107,7 @@ class todo extends control } else { - $todo = $this->todo->findById($todoID); + $todo = $this->todo->getById($todoID); $this->todo->delete($todoID); echo js::locate($this->createLink('my', 'todo', "date={$todo->date}"), 'parent'); exit; diff --git a/trunk/module/todo/model.php b/trunk/module/todo/model.php index 5b4a6ba453..fe27118c8f 100644 --- a/trunk/module/todo/model.php +++ b/trunk/module/todo/model.php @@ -74,7 +74,7 @@ class todoModel extends model } /* 获得一条todo信息。*/ - public function findByID($todoID) + public function getById($todoID) { $todo = $this->dao->findById((int)$todoID)->from(TABLE_TODO)->fetch(); if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); diff --git a/trunk/module/tree/control.php b/trunk/module/tree/control.php index 4502fdfbf8..d178a36975 100644 --- a/trunk/module/tree/control.php +++ b/trunk/module/tree/control.php @@ -38,13 +38,13 @@ class tree extends control /* 设置当前的产品。*/ private function setProduct($productID) { - $this->product = $this->product->findByID($productID); + $this->product = $this->product->getById($productID); } /* 模块列表。*/ public function browse($productID, $viewType, $currentModuleID = 0) { - $product = $this->product->findByID($productID); + $product = $this->product->getById($productID); if($viewType == 'product') {