* fix bug #656 in backyard pms.

This commit is contained in:
wangyidong
2015-11-19 09:27:53 +08:00
parent 7955810546
commit a05357d964
2 changed files with 4 additions and 4 deletions

View File

@@ -110,10 +110,10 @@ class todoModel extends model
public function update($todoID)
{
$oldTodo = $this->getById($todoID);
if($oldTodo->type != 'custom') $oldTodo->name = '';
if($oldTodo->type == 'bug' or $oldTodo->type == 'task') $oldTodo->name = '';
$todo = fixer::input('post')
->cleanInt('date, pri, begin, end, private')
->setIF($this->post->type != 'custom', 'name', '')
->setIF($this->post->type == 'bug' or $this->post->type == 'task', 'name', '')
->setIF($this->post->date == false, 'date', '2030-01-01')
->setIF($this->post->begin == false, 'begin', '2400')
->setIF($this->post->end == false, 'end', '2400')
@@ -166,7 +166,7 @@ class todoModel extends model
foreach($todos as $todoID => $todo)
{
$oldTodo = $this->getById($todoID);
if($oldTodo->type != 'custom') $oldTodo->name = '';
if($oldTodo->type == 'bug' or $oldTodo->type == 'task') $oldTodo->name = '';
$this->dao->update(TABLE_TODO)->data($todo)
->autoCheck()
->checkIF($todo->type == 'custom', $this->config->todo->edit->requiredFields, 'notempty')

View File

@@ -45,7 +45,7 @@
<th><?php echo $lang->todo->name;?></th>
<td colspan='2'><div id='nameBox'>
<?php
$readType = $todo->type != 'custom' ? 'readonly' : '';
$readType = ($todo->type == 'bug' or $todo->type == 'task') ? 'readonly' : '';
echo html::input('name', $todo->name, "$readType class=form-control");
?>
</div>