From d3eb34e1035e5b203abf7be9bba130c2c536844a Mon Sep 17 00:00:00 2001 From: yysa Date: Mon, 10 Nov 2014 21:05:27 +0100 Subject: [PATCH] Fix signature differences for check method --- app/controller/iphone.php | 4 ++-- app/controller/task.php | 8 ++++---- app/model/member.php | 4 ++-- app/model/task.php | 2 +- app/model/timer.php | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/controller/iphone.php b/app/controller/iphone.php index 942d42e..284b66c 100644 --- a/app/controller/iphone.php +++ b/app/controller/iphone.php @@ -150,7 +150,7 @@ class Iphone extends AppController { $this->_loadTask(false); $this->edit->ignore('creation_date'); // do not submit or change creation date $this->edit->set($this->fc->request); - if ($this->edit->check($this->fc->user->getUid())) { + if ($this->edit->checkUid($this->fc->user->getUid())) { $this->edit->save(); } echo ''; echo ''; } -} \ No newline at end of file +} diff --git a/app/controller/task.php b/app/controller/task.php index 9330ad4..97b7430 100644 --- a/app/controller/task.php +++ b/app/controller/task.php @@ -193,7 +193,7 @@ class Task extends AppController { if ($this->fc->getReqVar('start')) { $obj->set('deadline', APP_SQL_TODAY); } - if ($obj->check($this->switch_id)) { + if ($obj->checkUid($this->switch_id)) { $obj->insert(); } if ($this->fc->chkReqVar('start')) { @@ -300,7 +300,7 @@ class Task extends AppController { if ($objTask = TaskModel::parse($val, $defValue, $defDate)) { // really creating a task $objTask->connectDb(); - if ($objTask->check($this->switch_id)) { + if ($objTask->checkUid($this->switch_id)) { $objTask->insert(); $i++; } @@ -322,7 +322,7 @@ class Task extends AppController { $id = $this->_loadTask(); $this->data->ignore('creation_date'); // do not submit or change creation date $this->data->set($this->fc->request); - if ($this->data->check($this->switch_id)) { + if ($this->data->checkUid($this->switch_id)) { $this->data->save(); $this->fc->redirect(APP_WWW_URI,($id)?'task_updated':'task_created'); } @@ -357,4 +357,4 @@ class Task extends AppController { $this->page->add('jsCode', $js); } -} \ No newline at end of file +} diff --git a/app/model/member.php b/app/model/member.php index 7ae2450..870b391 100644 --- a/app/model/member.php +++ b/app/model/member.php @@ -37,8 +37,8 @@ class MemberModel extends UserAclModel { return implode(', ',$arrTrans); } - public function check() { - return parent::check('nickname,username'); + public function check($fields='nickname,username') { + return parent::check($fields); } } diff --git a/app/model/task.php b/app/model/task.php index ebd4f97..3a69856 100644 --- a/app/model/task.php +++ b/app/model/task.php @@ -34,7 +34,7 @@ class TaskModel extends Model { /** * check submitted data before saving task */ - public function check($usrId) { + public function checkUid($usrId) { if ($this->isEmpty('begin')) { $this->set('begin','9999-00-00'); } diff --git a/app/model/timer.php b/app/model/timer.php index 7fe8277..dbd8a23 100644 --- a/app/model/timer.php +++ b/app/model/timer.php @@ -30,8 +30,8 @@ class TimerModel extends Model { /** * check submitted data before saving task */ - public function check() { - return parent::check('task_id,start,stop,spent'); + public function check($fields='task_id,start,stop,spent') { + return parent::check($fields); } /**