* adjust the file module.

This commit is contained in:
wangchunsheng
2010-01-13 06:34:46 +00:00
parent ac9b7978c1
commit 13b7101231
9 changed files with 29 additions and 29 deletions
+4 -6
View File
@@ -47,13 +47,13 @@ class bugModel extends model
->cleanInt('product, module, severity')
->specialChars('steps')
->join('mailto', ',')
->remove('files, labels')
->get();
$this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck('title,type', 'notempty')->exec();
if(!dao::isError())
{
$bugID = $this->dao->lastInsertID();
$this->loadModel('file');
$this->file->saveUpload('files', 'bug', $bugID);
$this->loadModel('file')->saveUpload('bug', $bugID);
return $bugID;
}
return false;
@@ -79,9 +79,7 @@ class bugModel extends model
foreach($bug as $key => $value) if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $bug->$key = '';
$bug->mailto = ltrim(trim($bug->mailto), ',');
if($bug->duplicateBug) $bug->duplicateBugTitle = $this->dao->findById($bug->duplicateBug)->from(TABLE_BUG)->fields('title')->fetch('title');
$this->loadModel('file');
$bug->files = $this->file->getByObject('bug', $bugID);
$bug->files = $this->loadModel('file')->getByObject('bug', $bugID);
return $bug;
}
@@ -94,7 +92,7 @@ class bugModel extends model
->cleanInt('product,module,severity,project,story,task')
->stripTags('title')
->specialChars('steps')
->remove('comment')
->remove('comment,fiels,labels')
->setDefault('project,module,project,story,task,duplicateBug', 0)
->add('lastEditedBy', $this->app->user->account)
->add('lastEditedDate', $now)