Skip to content
Snippets Groups Projects
Commit f780d7e1 authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#1010 - Delete Reseller -> Customers messed up

parent ba9f0329
No related branches found
No related tags found
2 merge requests!46Master,!21Master
......@@ -9,4 +9,6 @@ $wb['Edit Client-Templates'] = 'Edit Client-Templates';
$wb['Add Reseller'] = 'Add Reseller';
$wb['Edit Reseller'] = 'Edit Reseller';
$wb['Resellers'] = 'Resellers';
$wb["error_has_clients"] = 'This reseller has clients. Delete the clients of the reseller first.';
?>
\ No newline at end of file
......@@ -51,6 +51,17 @@ $app->uses('tpl,tform');
$app->load('tform_actions');
class page_action extends tform_actions {
function onBeforeDelete() {
global $app, $conf;
$client_id = intval($this->dataRecord['client_id']);
$tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE parent_client_id = ".$client_id);
if($tmp["number"] > 0) $app->error($app->lng('error_has_clients'));
}
function onAfterDelete() {
global $app, $conf;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment