* code for task #5387.
This commit is contained in:
@@ -1939,45 +1939,6 @@ class bugModel extends model
|
||||
foreach($commonOption->graph as $key => $value) if(!isset($chartOption->graph->$key)) $chartOption->graph->$key = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bug templates of a user.
|
||||
*
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserBugTemplates($account)
|
||||
{
|
||||
$templates = $this->dao->select('id,account,title,content,public')
|
||||
->from(TABLE_USERTPL)
|
||||
->where('type')->eq('bug')
|
||||
->andwhere('account', true)->eq($account)
|
||||
->orWhere('public')->eq('1')
|
||||
->markRight(1)
|
||||
->orderBy('id')
|
||||
->fetchAll();
|
||||
return $templates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save user template.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveUserBugTemplate()
|
||||
{
|
||||
$template = fixer::input('post')
|
||||
->setDefault('account', $this->app->user->account)
|
||||
->setDefault('type', 'bug')
|
||||
->stripTags('content', $this->config->allowedTags)
|
||||
->get();
|
||||
|
||||
$condition = "`type`='bug' and account='{$this->app->user->account}'";
|
||||
$this->dao->insert(TABLE_USERTPL)->data($template)->batchCheck('title, content', 'notempty')->check('title', 'unique', $condition)->exec();
|
||||
if(!dao::isError()) $this->loadModel('score')->create('bug', 'saveTplModal', $this->dao->lastInsertID());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the file => label pairs of some fields.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user