From a05357d9649c5b886ef56715ffa8bd7ca7df1b02 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 19 Nov 2015 09:27:53 +0800 Subject: [PATCH] * fix bug #656 in backyard pms. --- module/todo/model.php | 6 +++--- module/todo/view/edit.html.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/todo/model.php b/module/todo/model.php index 47a49eb31b..8031a80a98 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -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') diff --git a/module/todo/view/edit.html.php b/module/todo/view/edit.html.php index 84ade21f90..fa3f5ef9d2 100644 --- a/module/todo/view/edit.html.php +++ b/module/todo/view/edit.html.php @@ -45,7 +45,7 @@ todo->name;?>
type != 'custom' ? 'readonly' : ''; + $readType = ($todo->type == 'bug' or $todo->type == 'task') ? 'readonly' : ''; echo html::input('name', $todo->name, "$readType class=form-control"); ?>