Fix signature differences for check method
This commit is contained in:
parent
02caa4eb24
commit
d3eb34e103
|
|
@ -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>';
|
||||||
|
|
@ -447,4 +447,4 @@ class Iphone extends AppController {
|
||||||
// echo '<script>app.bindList("'.$name.'");</script>';
|
// echo '<script>app.bindList("'.$name.'");</script>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
@ -357,4 +357,4 @@ class Task extends AppController {
|
||||||
$this->page->add('jsCode', $js);
|
$this->page->add('jsCode', $js);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue