+ complete task #256, #257 and #258:add bug template for bug steps.

This commit is contained in:
fujia
2010-07-22 10:04:27 +00:00
parent cb4ac4cae4
commit 87998afbf4
8 changed files with 63 additions and 6 deletions

View File

@@ -438,4 +438,26 @@ class bugModel extends model
/* 合并配置。*/
foreach($commonOption->graph as $key => $value) if(!isset($chartOption->graph->$key)) $chartOption->graph->$key = $value;
}
/* 获得用户的Bug模板列表。*/
public function getUserBugTemplates($account)
{
$templates = $this->dao->select('id, title, content')
->from(TABLE_USERTPL)
->where('account')->eq($account)
->orderBy('id')
->fetchAll();
return $templates;
}
/* 保存用户的BUG模板。*/
public function saveUserBugTemplate()
{
$template = fixer::input('post')
->specialChars('title, content')
->add('account', $this->app->user->account)
->add('type', 'bug')
->get();
$this->dao->insert(TABLE_USERTPL)->data($template)->autoCheck('title, content', 'notempty')->check('title', 'unique')->exec();
}
}