return ($emptyValid ? true : false);
global $user;
- $decimal = $user->decimal_mark;
+ $decimal = $user->getDecimalMark();
if (!preg_match('/^-?[0-9'.$decimal.']+$/', $val))
return false;
global $user;
$mdb2 = getConnection();
+ $user_id = $user->getUser();
$group_id = $user->getGroup();
$org_id = $user->org_id;
$id = (int) $fields['id'];
$date = $fields['date'];
- $user_id = (int) $fields['user_id'];
$client_id = $fields['client_id'];
$project_id = $fields['project_id'];
$name = $fields['name'];
// otherwise de-activate the bind (set its status to inactive). This will keep the bind
// and its rate in database for reporting.
- $all_projects = ttTeamHelper::getAllProjects($user->group_id);
+ $all_projects = ttTeamHelper::getAllProjects($user->getGroup());
$assigned_projects = isset($fields['projects']) ? $fields['projects'] : array();
foreach($all_projects as $p) {
var comment_control = document.getElementById("item_name");
var cost_control = document.getElementById("cost");
- var replaceDecimalMark = ("." != "{$user->decimal_mark}");
+ var replaceDecimalMark = ("." != "{$user->getDecimalMark()}");
// Calculate cost.
var dropdown = document.getElementById("predefined_expense");
else {
var expenseCost = defined_expenses[dropdown.selectedIndex - 1][2];
if (replaceDecimalMark)
- expenseCost = expenseCost.replace("{$user->decimal_mark}", ".");
+ expenseCost = expenseCost.replace("{$user->getDecimalMark()}", ".");
var newCost = (quantity_control.value * expenseCost).toFixed(2);
if (replaceDecimalMark)
- newCost = newCost.replace(".", "{$user->decimal_mark}");
+ newCost = newCost.replace(".", "{$user->getDecimalMark()}");
cost_control.value = newCost;
}
}
<td>{$forms.expenseItemForm.client.control}</td>
</tr>
{/if}
-{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{if $show_project}
<tr>
<td align="right">{$i18n.label.project} (*):</td>
<td>{$forms.expenseItemForm.project.control}</td>
</tr>
<tr>
<td align="right">{$i18n.label.cost}:</td>
- <td>{$forms.expenseItemForm.cost.control} {$user->currency|escape}</td>
+ <td>{$forms.expenseItemForm.cost.control} {$user->getCurrency()|escape}</td>
</tr>
{if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))}
<tr>
</tr>
<tr>
<td align="right">{$i18n.label.cost} (*):</td>
- <td>{$forms.expensesForm.cost.control} {$user->currency|escape}</td>
+ <td>{$forms.expensesForm.cost.control} {$user->getCurrency()|escape}</td>
</tr>
</table>
</td>
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.29.4592 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.29.4593 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
// Now, an update.
if ($err->no()) {
- if (ttExpenseHelper::update(array('id'=>$cl_id,'date'=>$new_date->toString(DB_DATEFORMAT),'user_id'=>$user->getUser(),
+ if (ttExpenseHelper::update(array('id'=>$cl_id,'date'=>$new_date->toString(DB_DATEFORMAT),
'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'paid'=>$cl_paid))) {
header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT));
exit();
$smarty->assign('confirm_save', true);
$smarty->assign('entry_date', $cl_date);
}
+$smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('show_project', $show_project);
$smarty->assign('predefined_expenses', $predefined_expenses);
$smarty->assign('client_list', $client_list);
$smarty->assign('project_list', $project_list);
$smarty->assign('task_list', $task_list);
-$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('title', $i18n->get('title.edit_expense'));
$smarty->assign('content_page_name', 'expense_edit.tpl');
$smarty->display('index.tpl');