projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A bit more refactoring for subgroups.
[timetracker.git]
/
client_add.php
diff --git
a/client_add.php
b/client_add.php
index
c0526e5
..
b3d27ac
100644
(file)
--- a/
client_add.php
+++ b/
client_add.php
@@
-31,13
+31,17
@@
import('form.Form');
import('ttClientHelper');
import('ttTeamHelper');
import('ttClientHelper');
import('ttTeamHelper');
-// Access check.
-if (!ttAccessAllowed('manage_clients')
|| !$user->isPluginEnabled('cl')
) {
+// Access check
s
.
+if (!ttAccessAllowed('manage_clients')) {
header('Location: access_denied.php');
exit();
}
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'));
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(
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,
'name' => $cl_name,
'address' => $cl_address,
'tax' => $cl_tax,
@@
-78,7
+83,7
@@
if ($request->isPost()) {
} else
$err->add($i18n->get('error.db'));
} else
} else
$err->add($i18n->get('error.db'));
} else
- $err->add($i18n->get('error.
clien
t_exists'));
+ $err->add($i18n->get('error.
objec
t_exists'));
}
} // isPost
}
} // isPost