diff --git a/module/bug/model.php b/module/bug/model.php index 1986480805..c871af90a1 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -194,8 +194,7 @@ class bugModel extends model $title = trim($title); if(empty($title)) { - $canNotEmpty = $this->common->checkFieldEmpty('bug', $data, $i); - if($canNotEmpty) + if($this->common->checkValidRow('bug', $data, $i)) { dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->bug->title); return false; diff --git a/module/common/model.php b/module/common/model.php index 9df30517a2..9d4c484348 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -3483,7 +3483,7 @@ EOD; } /** - * Check the field should be empty. + * Check valid row. * * @param string $objectType * @param array $postData @@ -3491,7 +3491,7 @@ EOD; * @access public * @return bool */ - public function checkFieldEmpty($objectType, $postData = array(), $index = 0) + public function checkValidRow($objectType, $postData = array(), $index = 0) { if(empty($postData)) return false; diff --git a/module/story/model.php b/module/story/model.php index 4701f797b9..a3c6f4a7f1 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -499,8 +499,7 @@ class storyModel extends model { if(empty($title)) { - $canNotEmpty = $this->common->checkFieldEmpty('story', $stories, $i); - if($canNotEmpty) + if($this->common->checkValidRow('story', $stories, $i)) { dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->story->title); return false; diff --git a/module/task/model.php b/module/task/model.php index a3a0e7514d..ab144eebdf 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -355,8 +355,7 @@ class taskModel extends model if(empty($tasks->name[$i])) { - $canNotEmpty = $this->common->checkFieldEmpty('task', $tasks, $i); - if($canNotEmpty) + if($this->common->checkValidRow('task', $tasks, $i)) { dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->task->name); return false; diff --git a/module/testcase/model.php b/module/testcase/model.php index 9eef18b419..76b1739229 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -157,8 +157,7 @@ class testcaseModel extends model { if(empty($title)) { - $canNotEmpty = $this->common->checkFieldEmpty('testcase', $cases, $i); - if($canNotEmpty) + if($this->common->checkValidRow('testcase', $cases, $i)) { dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->testcase->title); return false;