projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A bit of ongoing cleanup after roles revamp.
[timetracker.git]
/
mobile
/
expense_edit.php
diff --git
a/mobile/expense_edit.php
b/mobile/expense_edit.php
index
8da55a1
..
f560f55
100644
(file)
--- a/
mobile/expense_edit.php
+++ b/
mobile/expense_edit.php
@@
-41,14
+41,14
@@
if (!$user->isPluginEnabled('ex')) {
header('Location: feature_disabled.php');
exit();
}
header('Location: feature_disabled.php');
exit();
}
-
-$cl_id = $request->getParameter('id');
-
+$cl_id = (int)$request->getParameter('id');
// Get the expense item we are editing.
$expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser());
// Get the expense item we are editing.
$expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser());
-
-// Prohibit editing invoiced items.
-if ($expense_item['invoice_id']) die($i18n->get('error.sys'));
+if (!$expense_item || $expense_item['invoice_id']) {
+ // Prohibit editing not ours or invoiced items.
+ header('Location: access_denied.php');
+ exit();
+}
$item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']);
$item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']);
@@
-73,7
+73,7
@@
$form = new Form('expenseItemForm');
// Dropdown for clients in MODE_TIME. Use all active clients.
if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
// Dropdown for clients in MODE_TIME. Use all active clients.
if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
- $active_clients = ttTeamHelper::getActiveClients($user->
team
_id, true);
+ $active_clients = ttTeamHelper::getActiveClients($user->
group
_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'name'=>'client',
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'name'=>'client',
@@
-98,7
+98,7
@@
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
- $active_clients = ttTeamHelper::getActiveClients($user->
team
_id, true);
+ $active_clients = ttTeamHelper::getActiveClients($user->
group
_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
$projects_assigned_to_user[] = $project['id'];
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
$projects_assigned_to_user[] = $project['id'];
@@
-124,7
+124,7
@@
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t
}
}
// If predefined expenses are configured, add controls to select an expense and quantity.
}
}
// If predefined expenses are configured, add controls to select an expense and quantity.
-$predefined_expenses = ttTeamHelper::getPredefinedExpenses($user->
team
_id);
+$predefined_expenses = ttTeamHelper::getPredefinedExpenses($user->
group
_id);
if ($predefined_expenses) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'recalculateCost();',
if ($predefined_expenses) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'recalculateCost();',