* complete task #208

This commit is contained in:
fujia
2010-05-31 03:40:44 +00:00
parent c18ebfddc9
commit d19cdf8baf
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -36,15 +36,18 @@ class todoModel extends model
->specialChars('type,name,desc')
->cleanInt('date, pri, begin, end, private')
->setIF($this->post->type != 'custom', 'name', '')
->setIF($this->post->type == 'bug', 'idvalue', $this->post->bug)
->setIF($this->post->type == 'task', 'idvalue', $this->post->task)
->setIF($this->post->type == 'bug' and $this->post->bug, 'idvalue', $this->post->bug)
->setIF($this->post->type == 'task' and $this->post->task, 'idvalue', $this->post->task)
->setIF($this->post->begin == false, 'begin', '2400')
->setIF($this->post->end == false, 'end', '2400')
->remove('bug, task')
->get();
$this->dao->insert(TABLE_TODO)->data($todo)
->autoCheck()
->checkIF($todo->type == 'custom', $this->config->todo->create->requiredFields, 'notempty')
->checkIF($todo->type == 'bug' and $todo->idvalue == 0, 'idvalue', 'notempty')
->checkIF($todo->type == 'task' and $todo->idvalue == 0, 'idvalue', 'notempty')
->exec();
return $this->dao->lastInsertID();
}