* adjust the funcname name, change findById to getById.
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -40,7 +40,7 @@ class productModel extends model
|
||||
}
|
||||
|
||||
/* ͨ<><CDA8>ID<49><44>ȡ<EFBFBD><C8A1>Ʒ<EFBFBD><C6B7>Ϣ<EFBFBD><CFA2>*/
|
||||
public function findByID($productID)
|
||||
public function getById($productID)
|
||||
{
|
||||
return $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
/* 没有指定结束日期的情况。*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 = '实际情况';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user