X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mobile%2Fclient_add.php;h=7a097b5ff5a98d9561b0da240e0ac5b589a514c4;hb=d6a5ffec0f76b9ab5b1ee4f8e69ecdb2afd7c0ff;hp=134819bb10e55c3caeb9e1f756bf9ba1b3e977fb;hpb=a62e4bdd1bc89ea4f3cf29507399b5b8f229597a;p=timetracker.git diff --git a/mobile/client_add.php b/mobile/client_add.php index 134819bb..7a097b5f 100644 --- a/mobile/client_add.php +++ b/mobile/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,