X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=client_add.php;h=b3d27ac79b2ea455807bfb6dcaa3a2fdff766f5b;hb=109089e858e28200e714a790883c236230b3922f;hp=c0526e51b152bea7927f8a74b8b52d297ab6eba3;hpb=a0dd058ab6007cfc6a72713215a7f4abb96f1b45;p=timetracker.git diff --git a/client_add.php b/client_add.php index c0526e51..b3d27ac7 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->getGroup(), + 'org_id' => $user->org_id, 'name' => $cl_name, 'address' => $cl_address, 'tax' => $cl_tax, @@ -78,7 +83,7 @@ if ($request->isPost()) { } else $err->add($i18n->get('error.db')); } else - $err->add($i18n->get('error.client_exists')); + $err->add($i18n->get('error.object_exists')); } } // isPost