tbrehm
2010-01-19 f780d7e14cb8f03dd7f75ed4973a5e6955b25840
Fixed: FS#1010 - Delete Reseller -> Customers messed up
2 files modified
13 ■■■■■ changed files
interface/web/client/lib/lang/en.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/client/reseller_del.php 11 ●●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/en.lng
@@ -9,4 +9,6 @@
$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.';
?>
interface/web/client/reseller_del.php
@@ -51,6 +51,17 @@
$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;