projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring, moving plugin config options into config field.
[timetracker.git]
/
client_edit.php
diff --git
a/client_edit.php
b/client_edit.php
index
2b26d86
..
7b572ea
100644
(file)
--- a/
client_edit.php
+++ b/
client_edit.php
@@
-41,8
+41,13
@@
if (!$user->isPluginEnabled('cl')) {
header('Location: feature_disabled.php');
exit();
}
header('Location: feature_disabled.php');
exit();
}
-
-$cl_id = (int) $request->getParameter('id');
+$cl_id = (int)$request->getParameter('id');
+$client = ttClientHelper::getClient($cl_id, true);
+if (!$client) {
+ header('Location: access_denied.php');
+ exit();
+}
+// End of access checks.
$projects = ttGroupHelper::getActiveProjects();
$projects = ttGroupHelper::getActiveProjects();
@@
-53,7
+58,6
@@
if ($request->isPost()) {
$cl_status = $request->getParameter('status');
$cl_projects = $request->getParameter('projects');
} else {
$cl_status = $request->getParameter('status');
$cl_projects = $request->getParameter('projects');
} else {
- $client = ttClientHelper::getClient($cl_id, true);
$cl_name = $client['name'];
$cl_address = $client['address'];
$cl_tax = $client['tax'];
$cl_name = $client['name'];
$cl_address = $client['address'];
$cl_tax = $client['tax'];
@@
-105,10
+109,7
@@
if ($request->isPost()) {
if ($request->getParameter('btn_copy')) {
if (!ttClientHelper::getClientByName($cl_name)) {
if ($request->getParameter('btn_copy')) {
if (!ttClientHelper::getClientByName($cl_name)) {
- if (ttClientHelper::insert(array(
- 'group_id' => $user->getGroup(),
- 'org_id' => $user->org_id,
- 'name' => $cl_name,
+ if (ttClientHelper::insert(array('name' => $cl_name,
'address' => $cl_address,
'tax' => $cl_tax,
'status' => $cl_status,
'address' => $cl_address,
'tax' => $cl_tax,
'status' => $cl_status,