Fix signature differences for check method

This commit is contained in:
yysa 2014-11-10 21:05:27 +01:00
parent 02caa4eb24
commit d3eb34e103
5 changed files with 11 additions and 11 deletions

View File

@ -150,7 +150,7 @@ class Iphone extends AppController {
$this->_loadTask(false); $this->_loadTask(false);
$this->edit->ignore('creation_date'); // do not submit or change creation date $this->edit->ignore('creation_date'); // do not submit or change creation date
$this->edit->set($this->fc->request); $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(); $this->edit->save();
} }
echo '<script>'; echo '<script>';

View File

@ -193,7 +193,7 @@ class Task extends AppController {
if ($this->fc->getReqVar('start')) { if ($this->fc->getReqVar('start')) {
$obj->set('deadline', APP_SQL_TODAY); $obj->set('deadline', APP_SQL_TODAY);
} }
if ($obj->check($this->switch_id)) { if ($obj->checkUid($this->switch_id)) {
$obj->insert(); $obj->insert();
} }
if ($this->fc->chkReqVar('start')) { if ($this->fc->chkReqVar('start')) {
@ -300,7 +300,7 @@ class Task extends AppController {
if ($objTask = TaskModel::parse($val, $defValue, $defDate)) { if ($objTask = TaskModel::parse($val, $defValue, $defDate)) {
// really creating a task // really creating a task
$objTask->connectDb(); $objTask->connectDb();
if ($objTask->check($this->switch_id)) { if ($objTask->checkUid($this->switch_id)) {
$objTask->insert(); $objTask->insert();
$i++; $i++;
} }
@ -322,7 +322,7 @@ class Task extends AppController {
$id = $this->_loadTask(); $id = $this->_loadTask();
$this->data->ignore('creation_date'); // do not submit or change creation date $this->data->ignore('creation_date'); // do not submit or change creation date
$this->data->set($this->fc->request); $this->data->set($this->fc->request);
if ($this->data->check($this->switch_id)) { if ($this->data->checkUid($this->switch_id)) {
$this->data->save(); $this->data->save();
$this->fc->redirect(APP_WWW_URI,($id)?'task_updated':'task_created'); $this->fc->redirect(APP_WWW_URI,($id)?'task_updated':'task_created');
} }

View File

@ -37,8 +37,8 @@ class MemberModel extends UserAclModel {
return implode(', ',$arrTrans); return implode(', ',$arrTrans);
} }
public function check() { public function check($fields='nickname,username') {
return parent::check('nickname,username'); return parent::check($fields);
} }
} }

View File

@ -34,7 +34,7 @@ class TaskModel extends Model {
/** /**
* check submitted data before saving task * check submitted data before saving task
*/ */
public function check($usrId) { public function checkUid($usrId) {
if ($this->isEmpty('begin')) { if ($this->isEmpty('begin')) {
$this->set('begin','9999-00-00'); $this->set('begin','9999-00-00');
} }

View File

@ -30,8 +30,8 @@ class TimerModel extends Model {
/** /**
* check submitted data before saving task * check submitted data before saving task
*/ */
public function check() { public function check($fields='task_id,start,stop,spent') {
return parent::check('task_id,start,stop,spent'); return parent::check($fields);
} }
/** /**