X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/a62e4bdd1bc89ea4f3cf29507399b5b8f229597a..f05a2db179417c20c7d841f0363bca4988c8a2ca:/mobile/client_add.php diff --git a/mobile/client_add.php b/mobile/client_add.php index 134819bb..02de56d1 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, @@ -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