X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=client_add.php;h=dc99e6c8949ad837287a81b85345c8b7c7f62feb;hb=15ae2165165da813912300d223c50b74f44cc1e0;hp=c0526e51b152bea7927f8a74b8b52d297ab6eba3;hpb=a0dd058ab6007cfc6a72713215a7f4abb96f1b45;p=timetracker.git diff --git a/client_add.php b/client_add.php index c0526e51..dc99e6c8 100644 --- a/client_add.php +++ b/client_add.php @@ -31,13 +31,17 @@ import('form.Form'); import('ttClientHelper'); import('ttTeamHelper'); -// Access check. -if (!ttAccessAllowed('manage_clients') || !$user->isPluginEnabled('cl')) { +// Access checks. +if (!ttAccessAllowed('manage_clients')) { header('Location: access_denied.php'); exit(); } +if (!$user->isPluginEnabled('cl')) { + header('Location: feature_disabled.php'); + exit(); +} -$projects = ttTeamHelper::getActiveProjects($user->team_id); +$projects = ttTeamHelper::getActiveProjects($user->group_id); if ($request->isPost()) { $cl_name = trim($request->getParameter('name')); @@ -67,7 +71,8 @@ if ($request->isPost()) { if ($err->no()) { if (!ttClientHelper::getClientByName($cl_name)) { if (ttClientHelper::insert(array( - 'team_id' => $user->team_id, + 'group_id' => $user->getActiveGroup(), + 'org_id' => $user->org_id, 'name' => $cl_name, 'address' => $cl_address, 'tax' => $cl_tax,