| | |
| | | |
| | | // Calling the action functions |
| | | if($this->id > 0) { |
| | | $this->onUpdate(); |
| | | $app->tform->action == 'EDIT'; |
| | | $this->onUpdate(); |
| | | } else { |
| | | $this->onInsert(); |
| | | $app->tform->action == 'NEW'; |
| | | $this->onInsert(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | function onUpdateSave($sql) { |
| | | global $app; |
| | | if(!empty($sql) && !$app->tform->isReadonlyTab($app->tform->getCurrentTab())) { |
| | | if(!empty($sql) && !$app->tform->isReadonlyTab($app->tform->getCurrentTab(),$this->id)) { |
| | | $app->db->query($sql); |
| | | if($app->db->errorMessage != '') die($app->db->errorMessage); |
| | | } |
| | |
| | | function onError() { |
| | | global $app, $conf; |
| | | |
| | | $app->tpl->setVar("error","<b>".$app->lng('Error').":</b><br />".$app->tform->errorMessage); |
| | | $app->tpl->setVar("error","<li>".$app->tform->errorMessage."</li>"); |
| | | $app->tpl->setVar($this->dataRecord); |
| | | $this->onShow(); |
| | | } |