Hi, I have a little probleme with a custom module. I try to save 3 extras informations in a new table: id, name_ext, id_ext, desc_ext + classic informations(sys_userid, sys_groupid...) My form, load all configured customers on ISPConfig in a select box When i Save I lost the customer information, but id_ext, name_ext, desc_ext are correctly save I think i miss something in Onsubmit() function, but i don't see what. So i need your help please
Solution see => onAfterInsert Code: function onAfterInsert() { global $app, $conf; // make sure that the record belongs to the client group and not the admin group when a dmin inserts it // also make sure that the user can not delete domain created by a admin if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { $client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]); $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE domain_id = ".$this->id); } if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { $client_group_id = $app->functions->intval($this->dataRecord["client_group_id"]); $app->db->query("UPDATE mail_domain SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE domain_id = ".$this->id); }
This function is called on insert (creation) of the record only. If you want to store changes in your settings also when the form is edited and then saved again, then put the same code into the onAfterUpdate(...) function.