Commit f780d7e1 authored by tbrehm's avatar tbrehm
Browse files

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

parent ba9f0329
...@@ -9,4 +9,6 @@ $wb['Edit Client-Templates'] = 'Edit Client-Templates'; ...@@ -9,4 +9,6 @@ $wb['Edit Client-Templates'] = 'Edit Client-Templates';
$wb['Add Reseller'] = 'Add Reseller'; $wb['Add Reseller'] = 'Add Reseller';
$wb['Edit Reseller'] = 'Edit Reseller'; $wb['Edit Reseller'] = 'Edit Reseller';
$wb['Resellers'] = 'Resellers'; $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'); ...@@ -51,6 +51,17 @@ $app->uses('tpl,tform');
$app->load('tform_actions'); $app->load('tform_actions');
class page_action extends 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() { function onAfterDelete() {
global $app, $conf; global $app, $conf;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment