File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,6 @@ $wb['Edit Client-Templates'] = 'Edit Client-Templates';
99$wb['Add Reseller'] = 'Add Reseller';
1010$wb['Edit Reseller'] = 'Edit Reseller';
1111$wb['Resellers'] = 'Resellers';
12+ $wb["error_has_clients"] = 'This reseller has clients. Delete the clients of the reseller first.';
13+
1214?>
Original file line number Diff line number Diff line change 5151$ app ->load ('tform_actions ' );
5252
5353class page_action extends tform_actions {
54+
55+ function onBeforeDelete () {
56+ global $ app , $ conf ;
57+
58+ $ client_id = intval ($ this ->dataRecord ['client_id ' ]);
59+
60+ $ tmp = $ app ->db ->queryOneRecord ("SELECT count(client_id) as number FROM client WHERE parent_client_id = " .$ client_id );
61+ if ($ tmp ["number " ] > 0 ) $ app ->error ($ app ->lng ('error_has_clients ' ));
62+
63+ }
64+
5465 function onAfterDelete () {
5566 global $ app , $ conf ;
5667
You can’t perform that action at this time.
0 commit comments