* complete task #208
This commit is contained in:
@@ -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 = '今天';
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user