* complete task #208

This commit is contained in:
fujia
2010-05-31 03:40:44 +00:00
parent 3c16eb0829
commit 0267ec4d44
2 changed files with 6 additions and 2 deletions

View File

@@ -50,6 +50,7 @@ $lang->todo->name = '名称';
$lang->todo->status = '状态';
$lang->todo->desc = '描述';
$lang->todo->private = '私人事务';
$lang->todo->idvalue = '任务或Bug';
$lang->todo->week = '星期';
$lang->todo->today = '今天';

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();
}