return $value;
}
- // getKey is a legacy function that we are replacing with get.
- function getKey($kword) {
- return $this->get($kword);
- }
-
// TODO: refactoring ongoing down from here...
function getWeekDayName($id) {
$id = (int) $id;
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.67.4144 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.67.4145 | 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>
$expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser());
// Prohibit deleting invoiced records.
-if ($expense_item['invoice_id']) die($i18n->getKey('error.sys'));
+if ($expense_item['invoice_id']) die($i18n->get('error.sys'));
if ($request->isPost()) {
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it is okay to delete the record.
$item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']);
if ($user->isDateLocked($item_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
if ($err->no()) {
// Mark the record as deleted.
header('Location: expenses.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
if ($request->getParameter('cancel_button')) { // Cancel button pressed.
$form = new Form('expenseItemForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
-$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->get('button.cancel')));
$smarty->assign('expense_item', $expense_item);
$smarty->assign('forms', array($form->getName() => $form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.delete_expense'));
+$smarty->assign('title', $i18n->get('title.delete_expense'));
$smarty->assign('content_page_name', 'mobile/expense_delete.tpl');
$smarty->display('mobile/index.tpl');
$expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser());
// Prohibit editing invoiced items.
-if ($expense_item['invoice_id']) die($i18n->getKey('error.sys'));
+if ($expense_item['invoice_id']) die($i18n->get('error.sys'));
$item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']);
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
// If predefined expenses are configured, add controls to select an expense and quantity.
'value'=>$cl_predefined_expense,
'data'=>$predefined_expenses,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'text','onchange'=>'recalculateCost();','maxlength'=>'40','name'=>'quantity','style'=>'width: 100px;','value'=>$cl_quantity));
}
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'item_name','style'=>'width: 250px;','value'=>$cl_item_name));
// Hidden control for record id.
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save or btn_copy click.
-$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.copy')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.copy')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
- if (!ttValidString($cl_item_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.item'));
- if (!ttValidFloat($cl_cost)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cost'));
- if (!ttValidDate($cl_date)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.date'));
+ if (!ttValidString($cl_item_name)) $err->add($i18n->get('error.field'), $i18n->get('label.item'));
+ if (!ttValidFloat($cl_cost)) $err->add($i18n->get('error.field'), $i18n->get('label.cost'));
+ if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
// This is a new date for the expense item.
$new_date = new DateAndTime($user->date_format, $cl_date);
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($new_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Save record.
// Now, step by step.
// 1) Prohibit saving locked entries in any form.
if ($user->isDateLocked($item_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// 2) Prohibit saving unlocked entries into locked range.
if ($err->no() && $user->isDateLocked($new_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Now, an update.
if ($err->no()) {
if ($request->getParameter('btn_copy')) {
// We need to prohibit saving into locked interval.
if ($user->isDateLocked($new_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Now, a new insert.
if ($err->no()) {
header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT));
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
$smarty->assign('project_list', $project_list);
$smarty->assign('task_list', $task_list);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_expense'));
+$smarty->assign('title', $i18n->get('title.edit_expense'));
$smarty->assign('content_page_name', 'mobile/expense_edit.tpl');
$smarty->display('mobile/index.tpl');
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
// If predefined expenses are configured, add controls to select an expense and quantity.
'value'=>$cl_predefined_expense,
'data'=>$predefined_expenses,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'text','onchange'=>'recalculateCost();','maxlength'=>'40','name'=>'quantity','style'=>'width: 100px;','value'=>$cl_quantity));
}
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'item_name','style'=>'width: 250px;','value'=>$cl_item_name));
$form->addInput(array('type'=>'text','maxlength'=>'40','name'=>'cost','style'=>'width: 100px;','value'=>$cl_cost));
$form->addInput(array('type'=>'calendar','name'=>'date','highlight'=>'expenses','value'=>$cl_date)); // calendar
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_submit click.
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.submit')));
// Submit.
if ($request->isPost()) {
if ($request->getParameter('btn_submit')) {
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
- if (!ttValidString($cl_item_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.item'));
- if (!ttValidFloat($cl_cost)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cost'));
+ if (!ttValidString($cl_item_name)) $err->add($i18n->get('error.field'), $i18n->get('label.item'));
+ if (!ttValidFloat($cl_cost)) $err->add($i18n->get('error.field'), $i18n->get('label.cost'));
// Prohibit creating entries in future.
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($selected_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Finished validating input data.
// Prohibit creating entries in locked range.
if ($user->isDateLocked($selected_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Insert record.
if ($err->no()) {
header('Location: expenses.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} elseif ($request->getParameter('onBehalfUser')) {
if($user->canManageTeam()) {
$smarty->assign('project_list', $project_list);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('timestring', $selected_date->toString($user->date_format));
-$smarty->assign('title', $i18n->getKey('title.expenses'));
+$smarty->assign('title', $i18n->get('title.expenses'));
$smarty->assign('content_page_name', 'mobile/expenses.tpl');
$smarty->display('mobile/index.tpl');
$form->addInput(array('type'=>'text','size'=>'25','maxlength'=>'100','name'=>'login','style'=>'width: 220px;','value'=>$cl_login));
$form->addInput(array('type'=>'password','size'=>'25','maxlength'=>'50','name'=>'password','style'=>'width: 220px;','value'=>$cl_password));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_login click.
-$form->addInput(array('type'=>'submit','name'=>'btn_login','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.login')));
+$form->addInput(array('type'=>'submit','name'=>'btn_login','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.login')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
- if (!ttValidString($cl_password)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
+ if (!ttValidString($cl_password)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
if ($err->no()) {
}
exit();
} else
- $err->add($i18n->getKey('error.auth'));
+ $err->add($i18n->get('error.auth'));
}
} // isPost
if(!isTrue(MULTITEAM_MODE) && !ttGroupHelper::getTopGroups())
- $err->add($i18n->getKey('error.no_teams'));
+ $err->add($i18n->get('error.no_teams'));
// Determine whether to show login hint. It is currently used only for Windows LDAP authentication.
$show_hint = ('ad' == $GLOBALS['AUTH_MODULE_PARAMS']['type']);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('show_hint', $show_hint);
$smarty->assign('onload', 'onLoad="document.loginForm.'.(!$cl_login?'login':'password').'.focus()"');
-$smarty->assign('title', $i18n->getKey('title.login'));
+$smarty->assign('title', $i18n->get('title.login'));
$smarty->assign('content_page_name', 'mobile/login.tpl');
$smarty->display('mobile/index.tpl');
$form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users));
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks));
-$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
+$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if (!ttProjectHelper::getProjectByName($cl_name)) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.project_exists'));
+ $err->add($i18n->get('error.project_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"');
-$smarty->assign('title', $i18n->getKey('title.add_project'));
+$smarty->assign('title', $i18n->get('title.add_project'));
$smarty->assign('content_page_name', 'mobile/project_add.tpl');
$smarty->display('mobile/index.tpl');
$form = new Form('projectDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_project_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} elseif ($request->getParameter('btn_cancel')) {
header('Location: projects.php');
exit();
$smarty->assign('project_to_delete', $project_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.projectDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_project'));
+$smarty->assign('title', $i18n->get('title.delete_project'));
$smarty->assign('content_page_name', 'mobile/project_delete.tpl');
$smarty->display('mobile/index.tpl');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'project_name','value'=>$cl_name));
$form->addInput(array('type'=>'textarea','name'=>'description','class'=>'mobile-textarea','value'=>$cl_description));
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
- 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive'))));
+ 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
$form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users));
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks));
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->get('button.copy')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if ($request->getParameter('btn_save')) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.project_exists'));
+ $err->add($i18n->get('error.project_exists'));
}
if ($request->getParameter('btn_copy')) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.project_exists'));
+ $err->add($i18n->get('error.project_exists'));
}
if ($request->getParameter('btn_delete')) {
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"');
-$smarty->assign('title', $i18n->getKey('title.edit_project'));
+$smarty->assign('title', $i18n->get('title.edit_project'));
$smarty->assign('content_page_name', 'mobile/project_edit.tpl');
$smarty->display('mobile/index.tpl');
$smarty->assign('active_projects', $active_projects);
$smarty->assign('inactive_projects', $inactive_projects);
-$smarty->assign('title', $i18n->getKey('title.projects'));
+$smarty->assign('title', $i18n->get('title.projects'));
$smarty->assign('content_page_name', 'mobile/projects.tpl');
$smarty->display('mobile/index.tpl');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>$cl_name));
$form->addInput(array('type'=>'textarea','name'=>'description','class'=>'mobile-textarea','value'=>$cl_description));
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','layout'=>'H','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_projects));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.add')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.add')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if (!ttTaskHelper::getTaskByName($cl_name)) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.task_exists'));
+ $err->add($i18n->get('error.task_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.taskForm.name.focus()"');
-$smarty->assign('title', $i18n->getKey('title.add_task'));
+$smarty->assign('title', $i18n->get('title.add_task'));
$smarty->assign('content_page_name', 'mobile/task_add.tpl');
$smarty->display('mobile/index.tpl');
$form = new Form('taskDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_task_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} elseif ($request->getParameter('btn_cancel')) {
header('Location: tasks.php');
exit();
$smarty->assign('task_to_delete', $task_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.taskDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_task'));
+$smarty->assign('title', $i18n->get('title.delete_task'));
$smarty->assign('content_page_name', 'mobile/task_delete.tpl');
$smarty->display('mobile/index.tpl');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>$cl_name));
$form->addInput(array('type'=>'textarea','name'=>'description','class'=>'mobile-textarea','value'=>$cl_description));
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
- 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive'))));
+ 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','layout'=>'H','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_projects));
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->get('button.copy')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if ($request->getParameter('btn_save')) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.task_exists'));
+ $err->add($i18n->get('error.task_exists'));
}
if ($request->getParameter('btn_copy')) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.task_exists'));
+ $err->add($i18n->get('error.task_exists'));
}
if ($request->getParameter('btn_delete')) {
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_task'));
+$smarty->assign('title', $i18n->get('title.edit_task'));
$smarty->assign('content_page_name', 'mobile/task_edit.tpl');
$smarty->display('mobile/index.tpl');
$smarty->assign('active_tasks', ttTeamHelper::getActiveTasks($user->team_id));
$smarty->assign('inactive_tasks', ttTeamHelper::getInactiveTasks($user->team_id));
-$smarty->assign('title', $i18n->getKey('title.tasks'));
+$smarty->assign('title', $i18n->get('title.tasks'));
$smarty->assign('content_page_name', 'mobile/tasks.tpl');
$smarty->display('mobile/index.tpl');
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
'value'=>$cl_task,
'data'=>$task_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
$form->addInput(array('type'=>'text','name'=>'start','value'=>$cl_start,'onchange'=>"formDisable('start');"));
if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_submit click.
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.submit')));
// If we have custom fields - add controls for them.
if ($custom_fields && $custom_fields->fields[0]) {
'style'=>'width: 250px;',
'value'=>$cl_cf_1,
'data'=>$custom_fields->options,
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if ($custom_fields) {
- if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
+ if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
}
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
- if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ if (!$cl_task) $err->add($i18n->get('error.task'));
}
if (strlen($cl_duration) == 0) {
if ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.start'));
if ($cl_finish) {
if (!ttTimeHelper::isValidTime($cl_finish))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.finish'));
if (!ttTimeHelper::isValidInterval($cl_start, $cl_finish))
- $err->add($i18n->getKey('error.interval'), $i18n->getKey('label.finish'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.interval'), $i18n->get('label.finish'), $i18n->get('label.start'));
}
} else {
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.start'));
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.start'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.finish'));
}
if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.duration'));
}
} else {
if (false === ttTimeHelper::postedDurationToMinutes($cl_duration))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
}
- if (!ttValidString($cl_note, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.note'));
+ if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
// Finished validating user input.
// Prohibit creating entries in future.
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($selected_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Prohibit creating entries in locked range.
if ($user->isDateLocked($selected_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Prohibit creating another uncompleted record.
if ($err->no()) {
if (($not_completed_rec = ttTimeHelper::getUncompleted($user->getActiveUser())) && (($cl_finish == '') && ($cl_duration == '')))
- $err->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
+ $err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
}
// Prohibit creating an overlapping record.
if ($err->no()) {
if (ttTimeHelper::overlaps($user->getActiveUser(), $cl_date, $cl_start, $cl_finish))
- $err->add($i18n->getKey('error.overlap'));
+ $err->add($i18n->get('error.overlap'));
}
if ($err->no()) {
header('Location: time.php');
exit();
}
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
$smarty->assign('timestring', $selected_date->toString($user->date_format));
-$smarty->assign('title', $i18n->getKey('title.time'));
+$smarty->assign('title', $i18n->get('title.time'));
$smarty->assign('content_page_name', 'mobile/time.tpl');
$smarty->display('mobile/index.tpl');
$time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser());
// Prohibit deleting invoiced records.
-if ($time_rec['invoice_id']) die($i18n->getKey('error.sys'));
+if ($time_rec['invoice_id']) die($i18n->get('error.sys'));
// Escape comment for presentation.
$time_rec['comment'] = htmlspecialchars($time_rec['comment']);
$uncompleted = ($time_rec['duration'] == '0:00');
if ($user->isDateLocked($item_date) && !$uncompleted)
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
if ($err->no()) {
header('Location: time.php');
exit();
} else {
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
}
$form = new Form('timeRecordForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
-$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->get('button.cancel')));
$smarty->assign('time_rec', $time_rec);
$smarty->assign('forms', array($form->getName() => $form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.delete_time_record'));
+$smarty->assign('title', $i18n->get('title.delete_time_record'));
$smarty->assign('content_page_name', 'mobile/time_delete.tpl');
$smarty->display('mobile/index.tpl');
$time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser());
// Prohibit editing invoiced records.
-if ($time_rec['invoice_id']) die($i18n->getKey('error.sys'));
+if ($time_rec['invoice_id']) die($i18n->get('error.sys'));
$item_date = new DateAndTime(DB_DATEFORMAT, $time_rec['date']);
if (strlen($cl_start) > 0 && $cl_start == $cl_finish && $cl_duration == '0:00') {
$cl_finish = '';
$cl_duration = '';
- $msg->add($i18n->getKey('form.time_edit.uncompleted'));
+ $msg->add($i18n->get('form.time_edit.uncompleted'));
}
}
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
'value'=>$cl_task,
'data'=>$task_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
// Add other controls.
'style'=>'width: 250px;',
'value'=>$cl_cf_1,
'data'=>$custom_fields->options,
- 'empty' => array('' => $i18n->getKey('dropdown.select'))));
+ 'empty' => array('' => $i18n->get('dropdown.select'))));
}
}
// Hidden control for record id.
if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save click.
-$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if ($custom_fields) {
- if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
+ if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
}
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
- if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ if (!$cl_task) $err->add($i18n->get('error.task'));
}
if (!$cl_duration) {
if ('0' == $cl_duration)
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
elseif ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.start'));
if ($cl_finish) {
if (!ttTimeHelper::isValidTime($cl_finish))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.finish'));
if (!ttTimeHelper::isValidInterval($cl_start, $cl_finish))
- $err->add($i18n->getKey('error.interval'), $i18n->getKey('label.finish'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.interval'), $i18n->get('label.finish'), $i18n->get('label.start'));
}
} else {
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.start'));
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.start'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.finish'));
}
if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.duration'));
}
} else {
if (false === ttTimeHelper::postedDurationToMinutes($cl_duration))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
}
- if (!ttValidDate($cl_date)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.date'));
- if (!ttValidString($cl_note, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.note'));
+ if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
+ if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
// Finished validating user input.
// This is a new date for the time record.
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($new_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Save record.
if ($err->no()) {
// 1) Prohibit saving locked entries in any form.
if ($user->isDateLocked($item_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// 2) Prohibit saving completed unlocked entries into locked range.
if ($err->no() && $user->isDateLocked($new_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// 3) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists.
$uncompleted = ($cl_finish == '' && $cl_duration == '');
$not_completed_rec = ttTimeHelper::getUncompleted($user->getActiveUser());
if ($not_completed_rec && ($time_rec['id'] <> $not_completed_rec['id'])) {
// We have another not completed record.
- $err->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
+ $err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
}
}
}
// Prohibit creating an overlapping record.
if ($err->no()) {
if (ttTimeHelper::overlaps($user->getActiveUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish, $cl_id))
- $err->add($i18n->getKey('error.overlap'));
+ $err->add($i18n->get('error.overlap'));
}
// Now, an update.
$smarty->assign('task_list', $task_list);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
-$smarty->assign('title', $i18n->getKey('title.edit_time_record'));
+$smarty->assign('title', $i18n->get('title.edit_time_record'));
$smarty->assign('content_page_name', 'mobile/time_edit.tpl');
$smarty->display('mobile/index.tpl');
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
'value'=>$cl_task,
'data'=>$task_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable,'enable'=>$enable_controls));
$form->addInput(array('type'=>'hidden','name'=>'browser_time','value'=>'')); // User current time, which gets filled in on button click.
$enable_start = $uncompleted ? false : true;
if (!$uncompleted)
- $form->addInput(array('type'=>'submit','name'=>'btn_start','onclick'=>'browser_time.value=get_time()','value'=>$i18n->getKey('label.start'),'enable'=>$enable_start));
+ $form->addInput(array('type'=>'submit','name'=>'btn_start','onclick'=>'browser_time.value=get_time()','value'=>$i18n->get('label.start'),'enable'=>$enable_start));
else
- $form->addInput(array('type'=>'submit','name'=>'btn_stop','onclick'=>'browser_time.value=get_time()','value'=>$i18n->getKey('label.finish'),'enable'=>!$enable_start));
+ $form->addInput(array('type'=>'submit','name'=>'btn_stop','onclick'=>'browser_time.value=get_time()','value'=>$i18n->get('label.finish'),'enable'=>!$enable_start));
// If we have custom fields - add controls for them.
if ($custom_fields && $custom_fields->fields[0]) {
'style'=>'width: 250px;',
'value'=>$cl_cf_1,
'data'=>$custom_fields->options,
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))
));
}
}
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if ($custom_fields) {
- if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
+ if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
}
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ if (!$cl_task) $err->add($i18n->get('error.task'));
}
// Finished validating user input.
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($selected_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Prohibit creating time entries in locked interval.
if ($user->isDateLocked($selected_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Prohibit creating another uncompleted record.
if ($err->no() && $uncompleted) {
- $err->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
+ $err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
}
// Prohibit creating an overlapping record.
if ($err->no()) {
if (ttTimeHelper::overlaps($user->getActiveUser(), $cl_date, $cl_start, $cl_finish))
- $err->add($i18n->getKey('error.overlap'));
+ $err->add($i18n->get('error.overlap'));
}
if ($err->no()) {
header('Location: timer.php');
exit();
}
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
if ($request->getParameter('btn_stop')) {
header('Location: timer.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else {
// Cannot complete, redirect for manual edit.
header('Location: time_edit.php?id='.$record['id']);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
$smarty->assign('timestring', $selected_date->toString($user->date_format));
-$smarty->assign('title', $i18n->getKey('title.time'));
+$smarty->assign('title', $i18n->get('title.time'));
$smarty->assign('content_page_name', 'mobile/timer.tpl');
$smarty->display('mobile/index.tpl');
$project_with_rate['rate'] = $request->getParameter('rate_'.$p);
$assigned_projects[] = $project_with_rate;
} else
- $err->add($i18n->getKey('error.field'), 'rate_'.$p);
+ $err->add($i18n->get('error.field'), 'rate_'.$p);
}
}
}
$active_roles = ttTeamHelper::getActiveRolesForUser();
$form->addInput(array('type'=>'combobox','onchange'=>'handleClientControl()','name'=>'role','value'=>$cl_role_id,'data'=>$active_roles,'datakeys'=>array('id', 'name')));
if ($user->isPluginEnabled('cl'))
- $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'rate','format'=>'.2','value'=>$cl_rate));
$table->setData($projects);
$table->setKeyField('id');
$table->setValue($cl_projects);
-$table->addColumn(new TableColumn('name', $i18n->getKey('label.project'), new NameCellRenderer()));
-$table->addColumn(new TableColumn('p_rate', $i18n->getKey('form.users.rate'), new RateCellRenderer()));
+$table->addColumn(new TableColumn('name', $i18n->get('label.project'), new NameCellRenderer()));
+$table->addColumn(new TableColumn('p_rate', $i18n->get('form.users.rate'), new RateCellRenderer()));
$form->addInputElement($table);
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.person_name'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
if (!$auth->isPasswordExternal()) {
- if (!ttValidString($cl_password1)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
- if (!ttValidString($cl_password2)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.confirm_password'));
+ if (!ttValidString($cl_password1)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
+ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password'));
if ($cl_password1 !== $cl_password2)
- $err->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password'));
+ $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password'));
}
- if (!ttValidEmail($cl_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
- if (!ttValidFloat($cl_rate, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.users.default_rate'));
+ if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
+ if (!ttValidFloat($cl_rate, true)) $err->add($i18n->get('error.field'), $i18n->get('form.users.default_rate'));
if ($err->no()) {
if (!ttUserHelper::getUserByLogin($cl_login)) {
header('Location: users.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.user_exists'));
+ $err->add($i18n->get('error.user_exists'));
}
} // isPost
$smarty->assign('active_roles', $active_roles);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"');
-$smarty->assign('title', $i18n->getKey('title.add_user'));
+$smarty->assign('title', $i18n->get('title.add_user'));
$smarty->assign('content_page_name', 'mobile/user_add.tpl');
$smarty->display('mobile/index.tpl');
// Create confirmation form.
$form = new Form('userDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$user_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
}
exit();
} else {
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
if ($request->getParameter('btn_cancel')) {
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.delete_user'));
+$smarty->assign('title', $i18n->get('title.delete_user'));
$smarty->assign('content_page_name', 'mobile/user_delete.tpl');
$smarty->display('mobile/index.tpl');
$project_with_rate['rate'] = $request->getParameter('rate_'.$p);
$assigned_projects[] = $project_with_rate;
} else
- $err->add($i18n->getKey('error.field'), 'rate_'.$p);
+ $err->add($i18n->get('error.field'), 'rate_'.$p);
}
}
} else {
$active_roles = ttTeamHelper::getActiveRolesForUser();
$form->addInput(array('type'=>'combobox','onchange'=>'handleClientControl()','name'=>'role','value'=>$cl_role_id,'data'=>$active_roles,'datakeys'=>array('id', 'name')));
if ($user->isPluginEnabled('cl'))
- $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
- 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive'))));
+ 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'rate','format'=>'.2','value'=>$cl_rate));
// Define classes for the projects table.
$table->setData($projects);
$table->setKeyField('id');
$table->setValue($cl_projects);
-$table->addColumn(new TableColumn('name', $i18n->getKey('label.project'), new NameCellRenderer()));
-$table->addColumn(new TableColumn('p_rate', $i18n->getKey('form.users.rate'), new RateCellRenderer()));
+$table->addColumn(new TableColumn('name', $i18n->get('label.project'), new NameCellRenderer()));
+$table->addColumn(new TableColumn('p_rate', $i18n->get('form.users.rate'), new RateCellRenderer()));
$form->addInputElement($table);
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$user_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
if ($request->getParameter('btn_submit')) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.person_name'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
if (!$auth->isPasswordExternal() && ($cl_password1 || $cl_password2)) {
- if (!ttValidString($cl_password1)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
- if (!ttValidString($cl_password2)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.confirm_password'));
+ if (!ttValidString($cl_password1)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
+ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password'));
if ($cl_password1 !== $cl_password2)
- $err->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password'));
+ $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password'));
}
- if (!ttValidEmail($cl_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
- if (!ttValidFloat($cl_rate, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.users.default_rate'));
+ if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
+ if (!ttValidFloat($cl_rate, true)) $err->add($i18n->get('error.field'), $i18n->get('form.users.default_rate'));
if ($err->no()) {
$existing_user = ttUserHelper::getUserByLogin($cl_login);
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.user_exists'));
+ $err->add($i18n->get('error.user_exists'));
}
}
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"');
$smarty->assign('user_id', $user_id);
-$smarty->assign('title', $i18n->getKey('title.edit_user'));
+$smarty->assign('title', $i18n->get('title.edit_user'));
$smarty->assign('content_page_name', 'mobile/user_edit.tpl');
$smarty->display('mobile/index.tpl');
$smarty->assign('active_users', $active_users);
$smarty->assign('inactive_users', $inactive_users);
$smarty->assign('can_delete_manager', $can_delete_manager);
-$smarty->assign('title', $i18n->getKey('title.users'));
+$smarty->assign('title', $i18n->get('title.users'));
$smarty->assign('content_page_name', 'mobile/users.tpl');
$smarty->display('mobile/index.tpl');
'value'=>$cl_fav_report,
'data'=>$fav_reports,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))
));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'cron_spec','style'=>'width: 250px;','value'=>$cl_cron_spec));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','style'=>'width: 250px;','value'=>$cl_email));
$form->addInput(array('type'=>'text','name'=>'cc','style'=>'width: 300px;','value'=>$cl_cc));
$form->addInput(array('type'=>'text','name'=>'subject','style'=>'width: 300px;','value'=>$cl_subject));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'report_condition','style'=>'width: 250px;','value'=>$cl_report_condition));
-$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
+$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
if ($request->isPost()) {
// Validate user input.
- if (!$cl_fav_report) $err->add($i18n->getKey('error.report'));
- if (!ttValidCronSpec($cl_cron_spec)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.schedule'));
- if (!ttValidEmail($cl_email)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
- if (!ttValidEmail($cl_cc, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cc'));
- if (!ttValidString($cl_subject, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.subject'));
- if (!ttValidCondition($cl_report_condition)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.condition'));
+ if (!$cl_fav_report) $err->add($i18n->get('error.report'));
+ if (!ttValidCronSpec($cl_cron_spec)) $err->add($i18n->get('error.field'), $i18n->get('label.schedule'));
+ if (!ttValidEmail($cl_email)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
+ if (!ttValidEmail($cl_cc, true)) $err->add($i18n->get('error.field'), $i18n->get('label.cc'));
+ if (!ttValidString($cl_subject, true)) $err->add($i18n->get('error.field'), $i18n->get('label.subject'));
+ if (!ttValidCondition($cl_report_condition)) $err->add($i18n->get('error.field'), $i18n->get('label.condition'));
if ($err->no()) {
// Calculate next execution time.
header('Location: notifications.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.add_notification'));
+$smarty->assign('title', $i18n->get('title.add_notification'));
$smarty->assign('content_page_name', 'notification_add.tpl');
$smarty->display('index.tpl');
$form = new Form('notificationDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_notification_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: notifications.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} elseif ($request->getParameter('btn_cancel')) {
header('Location: notifications.php');
exit();
$smarty->assign('notification_to_delete', $notification_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.notificationDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_notification'));
+$smarty->assign('title', $i18n->get('title.delete_notification'));
$smarty->assign('content_page_name', 'notification_delete.tpl');
$smarty->display('index.tpl');
'value'=>$cl_fav_report,
'data'=>$fav_reports,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'cron_spec','style'=>'width: 250px;','value'=>$cl_cron_spec));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','style'=>'width: 250px;','value'=>$cl_email));
$form->addInput(array('type'=>'text','name'=>'cc','style'=>'width: 300px;','value'=>$cl_cc));
$form->addInput(array('type'=>'text','name'=>'subject','style'=>'width: 300px;','value'=>$cl_subject));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'report_condition','style'=>'width: 250px;','value'=>$cl_report_condition));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.save')));
if ($request->isPost()) {
// Validate user input.
- if (!$cl_fav_report) $err->add($i18n->getKey('error.report'));
- if (!ttValidCronSpec($cl_cron_spec)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.schedule'));
- if (!ttValidEmail($cl_email)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
- if (!ttValidEmail($cl_cc, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cc'));
- if (!ttValidString($cl_subject, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.subject'));
- if (!ttValidCondition($cl_report_condition)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.condition'));
+ if (!$cl_fav_report) $err->add($i18n->get('error.report'));
+ if (!ttValidCronSpec($cl_cron_spec)) $err->add($i18n->get('error.field'), $i18n->get('label.schedule'));
+ if (!ttValidEmail($cl_email)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
+ if (!ttValidEmail($cl_cc, true)) $err->add($i18n->get('error.field'), $i18n->get('label.cc'));
+ if (!ttValidString($cl_subject, true)) $err->add($i18n->get('error.field'), $i18n->get('label.subject'));
+ if (!ttValidCondition($cl_report_condition)) $err->add($i18n->get('error.field'), $i18n->get('label.condition'));
if ($err->no()) {
// Calculate next execution time.
header('Location: notifications.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_notification'));
+$smarty->assign('title', $i18n->get('title.edit_notification'));
$smarty->assign('content_page_name', 'notification_edit.tpl');
$smarty->display('index.tpl');
exit();
}
} else {
- $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
+ $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
$notifications = ttTeamHelper::getNotifications($user->team_id);
}
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('notifications', $notifications);
-$smarty->assign('title', $i18n->getKey('title.notifications'));
+$smarty->assign('title', $i18n->get('title.notifications'));
$smarty->assign('content_page_name', 'notifications.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'password','maxlength'=>'120','name'=>'password1','value'=>$cl_password1));
$form->addInput(array('type'=>'password','maxlength'=>'120','name'=>'password2','value'=>$cl_password2));
$form->addInput(array('type'=>'hidden','name'=>'ref','value'=>$cl_ref));
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_password1)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
- if (!ttValidString($cl_password2)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.confirm_password'));
+ if (!ttValidString($cl_password1)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
+ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password'));
if ($cl_password1 !== $cl_password2)
- $err->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password'));
+ $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password'));
if ($err->no()) {
// Use the "limit" plugin if we have one. Ignore include errors.
}
exit();
} else {
- $err->add($i18n->getKey('error.auth'));
+ $err->add($i18n->get('error.auth'));
}
}
} // isPost
$smarty->assign('forms', array($form->getName() => $form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.change_password'));
+$smarty->assign('title', $i18n->get('title.change_password'));
$smarty->assign('content_page_name', 'password_change.tpl');
$smarty->display('index.tpl');
$form = new Form('resetPasswordForm');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'login','style'=>'width: 300px;'));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.reset_password')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.reset_password')));
if ($request->isPost()) {
$cl_login = $request->getParameter('login');
// Validate user input.
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
if ($err->no()) {
if (!ttUserHelper::getUserByLogin($cl_login)) {
if ($login)
$cl_login = $login;
else
- $err->add($i18n->getKey('error.no_login'));
+ $err->add($i18n->get('error.no_login'));
} else
- $err->add($i18n->getKey('error.no_login'));
+ $err->add($i18n->get('error.no_login'));
}
}
if (ttValidEmail($cl_login))
$receiver = $cl_login;
else
- $err->add($i18n->getKey('error.no_email'));
+ $err->add($i18n->get('error.no_email'));
}
if ($receiver) {
else
$http = 'http';
- $cl_subject = $user_i18n->getKey('form.reset_password.email_subject');
+ $cl_subject = $user_i18n->get('form.reset_password.email_subject');
if (APP_NAME)
$pass_edit_url = $http.'://'.$_SERVER['HTTP_HOST'].'/'.APP_NAME.'/password_change.php?ref='.$temp_ref;
else
$pass_edit_url = $http.'://'.$_SERVER['HTTP_HOST'].'/password_change.php?ref='.$temp_ref;
$sender->setMailMode(MAIL_MODE);
- $res = $sender->send($cl_subject, sprintf($user_i18n->getKey('form.reset_password.email_body'), $_SERVER['REMOTE_ADDR'], $pass_edit_url));
- $smarty->assign('result_message', $res ? $i18n->getKey('form.reset_password.message') : $i18n->getKey('error.mail_send'));
+ $res = $sender->send($cl_subject, sprintf($user_i18n->get('form.reset_password.email_body'), $_SERVER['REMOTE_ADDR'], $pass_edit_url));
+ $smarty->assign('result_message', $res ? $i18n->get('form.reset_password.message') : $i18n->get('error.mail_send'));
}
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.resetPasswordForm.login.focus()"');
-$smarty->assign('title', $i18n->getKey('title.reset_password'));
+$smarty->assign('title', $i18n->get('title.reset_password'));
$smarty->assign('content_page_name', 'password_reset.tpl');
$smarty->display('index.tpl');
$form = new Form('predefinedExpenseForm');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','style'=>'width: 250px;','value'=>$cl_name));
$form->addInput(array('type'=>'text','maxlength'=>'40','name'=>'cost','style'=>'width: 100px;','value'=>$cl_cost));
-$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
+$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidFloat($cl_cost)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cost'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidFloat($cl_cost)) $err->add($i18n->get('error.field'), $i18n->get('label.cost'));
if ($err->no()) {
if (ttPredefinedExpenseHelper::insert(array(
'team_id' => $user->team_id,
header('Location: predefined_expenses.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.add_predefined_expense'));
+$smarty->assign('title', $i18n->get('title.add_predefined_expense'));
$smarty->assign('content_page_name', 'predefined_expense_add.tpl');
$smarty->display('index.tpl');
$form = new Form('predefinedExpenseDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_predefined_expense_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: predefined_expenses.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} elseif ($request->getParameter('btn_cancel')) {
header('Location: predefined_expenses.php');
exit();
$smarty->assign('predefined_expense_to_delete', $predefined_expense_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.predefinedExpenseDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_predefined_expense'));
+$smarty->assign('title', $i18n->get('title.delete_predefined_expense'));
$smarty->assign('content_page_name', 'predefined_expense_delete.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$predefined_expense_id));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','style'=>'width: 250px;','value'=>$cl_name));
$form->addInput(array('type'=>'text','maxlength'=>'40','name'=>'cost','style'=>'width: 100px;','value'=>$cl_cost));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidFloat($cl_cost)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cost'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidFloat($cl_cost)) $err->add($i18n->get('error.field'), $i18n->get('label.cost'));
if ($err->no()) {
if (ttPredefinedExpenseHelper::update(array(
'id' => $predefined_expense_id,
header('Location: predefined_expenses.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_predefined_expense'));
+$smarty->assign('title', $i18n->get('title.edit_predefined_expense'));
$smarty->assign('content_page_name', 'predefined_expense_edit.tpl');
$smarty->display('index.tpl');
exit();
}
} else {
- $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
+ $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
$predefinedExpenses = ttTeamHelper::getPredefinedExpenses($user->team_id);
}
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('predefined_expenses', $predefinedExpenses);
-$smarty->assign('title', $i18n->getKey('title.predefined_expenses'));
+$smarty->assign('title', $i18n->get('title.predefined_expenses'));
$smarty->assign('content_page_name', 'predefined_expenses.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'combobox','name'=>'date_format','style'=>'width: 150px;','data'=>$DATE_FORMAT_OPTIONS,'datakeys'=>array('id','name'),'value'=>$cl_date_format,
'onchange'=>'MakeFormatPreview("date_format_preview", this);'));
$TIME_FORMAT_OPTIONS = array(
- array('id'=>'%H:%M','name'=>$i18n->getKey('form.profile.24_hours')),
- array('id'=>'%I:%M %p','name'=>$i18n->getKey('form.profile.12_hours')));
+ array('id'=>'%H:%M','name'=>$i18n->get('form.profile.24_hours')),
+ array('id'=>'%I:%M %p','name'=>$i18n->get('form.profile.12_hours')));
$form->addInput(array('type'=>'combobox','name'=>'time_format','style'=>'width: 150px;','data'=>$TIME_FORMAT_OPTIONS,'datakeys'=>array('id','name'),'value'=>$cl_time_format,
'onchange'=>'MakeFormatPreview("time_format_preview", this);'));
// Prepare tracking mode choices.
$tracking_mode_options = array();
- $tracking_mode_options[MODE_TIME] = $i18n->getKey('form.profile.mode_time');
- $tracking_mode_options[MODE_PROJECTS] = $i18n->getKey('form.profile.mode_projects');
- $tracking_mode_options[MODE_PROJECTS_AND_TASKS] = $i18n->getKey('form.profile.mode_projects_and_tasks');
+ $tracking_mode_options[MODE_TIME] = $i18n->get('form.profile.mode_time');
+ $tracking_mode_options[MODE_PROJECTS] = $i18n->get('form.profile.mode_projects');
+ $tracking_mode_options[MODE_PROJECTS_AND_TASKS] = $i18n->get('form.profile.mode_projects_and_tasks');
$form->addInput(array('type'=>'combobox','name'=>'tracking_mode','style'=>'width: 150px;','data'=>$tracking_mode_options,'value'=>$cl_tracking_mode,'onchange'=>'handleTaskRequiredCheckbox()'));
$form->addInput(array('type'=>'checkbox','name'=>'project_required','value'=>$cl_project_required));
$form->addInput(array('type'=>'checkbox','name'=>'task_required','value'=>$cl_task_required));
// Prepare record type choices.
$record_type_options = array();
- $record_type_options[TYPE_ALL] = $i18n->getKey('form.profile.type_all');
- $record_type_options[TYPE_START_FINISH] = $i18n->getKey('form.profile.type_start_finish');
- $record_type_options[TYPE_DURATION] = $i18n->getKey('form.profile.type_duration');
+ $record_type_options[TYPE_ALL] = $i18n->get('form.profile.type_all');
+ $record_type_options[TYPE_START_FINISH] = $i18n->get('form.profile.type_start_finish');
+ $record_type_options[TYPE_DURATION] = $i18n->get('form.profile.type_duration');
$form->addInput(array('type'=>'combobox','name'=>'record_type','style'=>'width: 150px;','data'=>$record_type_options,'value'=>$cl_record_type));
// Punch mode checkbox.
$form->addInput(array('type'=>'checkbox','name'=>'quotas','value'=>$cl_quotas,'onchange'=>'handlePluginCheckboxes()'));
$form->addInput(array('type'=>'checkbox','name'=>'week_view','value'=>$cl_week_view,'onchange'=>'handlePluginCheckboxes()'));
}
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.person_name'));
if ($can_change_login) {
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
// New login must be unique.
if ($cl_login != $user->login && ttUserHelper::getUserByLogin($cl_login))
- $err->add($i18n->getKey('error.user_exists'));
+ $err->add($i18n->get('error.user_exists'));
}
if (!$auth->isPasswordExternal() && ($cl_password1 || $cl_password2)) {
- if (!ttValidString($cl_password1)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
- if (!ttValidString($cl_password2)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.confirm_password'));
+ if (!ttValidString($cl_password1)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
+ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password'));
if ($cl_password1 !== $cl_password2)
- $err->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password'));
+ $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password'));
}
- if (!ttValidEmail($cl_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
+ if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
if ($user->canManageTeam()) {
- if (!ttValidString($cl_team, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.team_name'));
- if (!ttValidString($cl_currency, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.currency'));
+ if (!ttValidString($cl_team, true)) $err->add($i18n->get('error.field'), $i18n->get('label.team_name'));
+ if (!ttValidString($cl_currency, true)) $err->add($i18n->get('error.field'), $i18n->get('label.currency'));
if ($user->isManager()) {
- if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.bcc'));
+ if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc'));
}
}
// Finished validating user input.
header('Location: time.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} // isPost
$smarty->assign('auth_external', $auth->isPasswordExternal());
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="handleTaskRequiredCheckbox(); handlePluginCheckboxes();"');
-$smarty->assign('title', $i18n->getKey('title.profile'));
+$smarty->assign('title', $i18n->get('title.profile'));
$smarty->assign('content_page_name', 'profile_edit.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users));
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks));
-$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
+$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if (!ttProjectHelper::getProjectByName($cl_name)) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.project_exists'));
+ $err->add($i18n->get('error.project_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"');
-$smarty->assign('title', $i18n->getKey('title.add_project'));
+$smarty->assign('title', $i18n->get('title.add_project'));
$smarty->assign('content_page_name', 'project_add.tpl');
$smarty->display('index.tpl');
$form = new Form('projectDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_project_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} elseif ($request->getParameter('btn_cancel')) {
header('Location: projects.php');
exit();
$smarty->assign('project_to_delete', $project_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.projectDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_project'));
+$smarty->assign('title', $i18n->get('title.delete_project'));
$smarty->assign('content_page_name', 'project_delete.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'project_name','style'=>'width: 250px;','value'=>$cl_name));
$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description));
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
- 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive'))));
+ 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
$form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users));
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks));
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->get('button.copy')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if ($request->getParameter('btn_save')) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.project_exists'));
+ $err->add($i18n->get('error.project_exists'));
}
if ($request->getParameter('btn_copy')) {
header('Location: projects.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.project_exists'));
+ $err->add($i18n->get('error.project_exists'));
}
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.projectForm.name.focus()"');
-$smarty->assign('title', $i18n->getKey('title.edit_project'));
+$smarty->assign('title', $i18n->get('title.edit_project'));
$smarty->assign('content_page_name', 'project_edit.tpl');
$smarty->display('index.tpl');
$smarty->assign('active_projects', $active_projects);
$smarty->assign('inactive_projects', $inactive_projects);
-$smarty->assign('title', $i18n->getKey('title.projects'));
+$smarty->assign('title', $i18n->get('title.projects'));
$smarty->assign('content_page_name', 'projects.tpl');
$smarty->display('index.tpl');
if ($request->isPost()){
// Validate user input.
if (false === ttTimeHelper::postedDurationToMinutes($request->getParameter('workdayHours')))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('form.quota.workday_hours'));
+ $err->add($i18n->get('error.field'), $i18n->get('form.quota.workday_hours'));
for ($i = 0; $i < count($months); $i++){
$val = $request->getParameter($months[$i]);
if (false === ttTimeHelper::postedDurationToMinutes($val, 44640/*24*60*31*/))
- $err->add($i18n->getKey('error.field'), $months[$i]);
+ $err->add($i18n->get('error.field'), $months[$i]);
}
// Finished validating user input.
$workday_minutes = ttTimeHelper::postedDurationToMinutes($request->getParameter('workdayHours'));
if ($workday_minutes != $user->workday_minutes) {
if (!ttTeamHelper::update($user->team_id, array('name'=>$user->team,'workday_minutes'=>$workday_minutes)))
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
// Handle monthly quotas for a selected year.
for ($i = 0; $i < count($months); $i++){
$quota_in_minutes = ttTimeHelper::postedDurationToMinutes($request->getParameter($months[$i]), 44640/*24*60*31*/);
if (!$quota->update($selectedYear, $i+1, $quota_in_minutes))
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
if ($err->no()) {
$smarty->assign('months', $months);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.monthly_quotas'));
+$smarty->assign('title', $i18n->get('title.monthly_quotas'));
$smarty->assign('content_page_name', 'quotas.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password1','value'=>$cl_password1));
$form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password2','value'=>$cl_password2));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
if ($request->isPost()) {
// Create fields array for ttRegistrator instance.
}
} // isPost
-$smarty->assign('title', $i18n->getKey('title.create_team'));
+$smarty->assign('title', $i18n->get('title.create_team'));
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.profileForm.team.focus()"');
$smarty->assign('content_page_name', 'register.tpl');
// Controls for "Mark paid" block.
if ($bean->getAttribute('chpaid')) {
- $mark_paid_select_options = array('1'=>$i18n->getKey('dropdown.all'),'2'=>$i18n->getKey('dropdown.select'));
+ $mark_paid_select_options = array('1'=>$i18n->get('dropdown.all'),'2'=>$i18n->get('dropdown.select'));
$form->addInput(array('type'=>'combobox',
'name'=>'mark_paid_select_options',
'data'=>$mark_paid_select_options,
'value'=>$cl_mark_paid_select_option));
- $mark_paid_action_options = array('1'=>$i18n->getKey('dropdown.paid'),'2'=>$i18n->getKey('dropdown.not_paid'));
+ $mark_paid_action_options = array('1'=>$i18n->get('dropdown.paid'),'2'=>$i18n->get('dropdown.not_paid'));
$form->addInput(array('type'=>'combobox',
'name'=>'mark_paid_action_options',
'data'=>$mark_paid_action_options,
'value'=>$cl_mark_paid_action_option));
- $form->addInput(array('type'=>'submit','name'=>'btn_mark_paid','value'=>$i18n->getKey('button.submit')));
+ $form->addInput(array('type'=>'submit','name'=>'btn_mark_paid','value'=>$i18n->get('button.submit')));
$smarty->assign('use_mark_paid', true);
}
// Client is selected and we are displaying the invoice column.
$recent_invoices = ttTeamHelper::getRecentInvoices($user->team_id, $client_id);
if ($recent_invoices) {
- $assign_invoice_select_options = array('1'=>$i18n->getKey('dropdown.all'),'2'=>$i18n->getKey('dropdown.select'));
+ $assign_invoice_select_options = array('1'=>$i18n->get('dropdown.all'),'2'=>$i18n->get('dropdown.select'));
$form->addInput(array('type'=>'combobox',
'name'=>'assign_invoice_select_options',
'data'=>$assign_invoice_select_options,
'data'=>$recent_invoices,
'datakeys'=>array('id','name'),
'value'=>$cl_recent_invoice_option,
- 'empty'=>array(''=>$i18n->getKey('dropdown.select_invoice'))));
- $form->addInput(array('type'=>'submit','name'=>'btn_assign','value'=>$i18n->getKey('button.submit')));
+ 'empty'=>array(''=>$i18n->get('dropdown.select_invoice'))));
+ $form->addInput(array('type'=>'submit','name'=>'btn_assign','value'=>$i18n->get('button.submit')));
$smarty->assign('use_assign_to_invoice', true);
}
}
if ('item_id_' == substr($key, 0, 8))
$expense_item_ids[] = substr($key, 8);
}
- if (!$time_log_ids && !$expense_item_ids) $err->Add($i18n->getKey('error.record')); // There are no selected records.
+ if (!$time_log_ids && !$expense_item_ids) $err->Add($i18n->get('error.record')); // There are no selected records.
// Validation of parameteres ended here.
} else {
// We are assigning all report items. Get the arrays from session.
$smarty->assign('group_by_header', $custom_fields->fields[0]['label']);
else {
$key = 'label.'.$group_by;
- $smarty->assign('group_by_header', $i18n->getKey($key));
+ $smarty->assign('group_by_header', $i18n->get($key));
}
}
// Assign variables that are used to alternate color of rows for different dates.
$smarty->assign('subtotals', $subtotals);
$smarty->assign('totals', $totals);
$smarty->assign('bean', $bean);
-$smarty->assign('title', $i18n->getKey('title.report').": ".$totals['start_date']." - ".$totals['end_date']);
+$smarty->assign('title', $i18n->get('title.report').": ".$totals['start_date']." - ".$totals['end_date']);
$smarty->assign('content_page_name', 'report.tpl');
$smarty->display('index.tpl');
} else {
$cl_receiver = $sc->getValue(SYSC_LAST_REPORT_EMAIL);
$cl_cc = $sc->getValue(SYSC_LAST_REPORT_CC);
- $cl_subject = $i18n->getKey('form.mail.report_subject');
+ $cl_subject = $i18n->get('form.mail.report_subject');
}
$form = new Form('mailForm');
$form->addInput(array('type'=>'text','name'=>'cc','style'=>'width: 300px;','value'=>$cl_cc));
$form->addInput(array('type'=>'text','name'=>'subject','style'=>'width: 300px;','value'=>$cl_subject));
$form->addInput(array('type'=>'textarea','name'=>'comment','maxlength'=>'250','style'=>'width: 300px; height: 60px;'));
-$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->getKey('button.send')));
+$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->get('button.send')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidEmailList($cl_receiver)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.to'));
- if (!ttValidEmailList($cl_cc, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cc'));
- if (!ttValidString($cl_subject)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.subject'));
- if (!ttValidString($cl_comment, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.comment'));
+ if (!ttValidEmailList($cl_receiver)) $err->add($i18n->get('error.field'), $i18n->get('form.mail.to'));
+ if (!ttValidEmailList($cl_cc, true)) $err->add($i18n->get('error.field'), $i18n->get('label.cc'));
+ if (!ttValidString($cl_subject)) $err->add($i18n->get('error.field'), $i18n->get('label.subject'));
+ if (!ttValidString($cl_comment, true)) $err->add($i18n->get('error.field'), $i18n->get('label.comment'));
if ($err->no()) {
// Save last report emails for future use.
$mailer->setReceiverBCC($user->bcc_email);
$mailer->setMailMode(MAIL_MODE);
if ($mailer->send($cl_subject, $body))
- $msg->add($i18n->getKey('form.mail.report_sent'));
+ $msg->add($i18n->get('form.mail.report_sent'));
else
- $err->add($i18n->getKey('error.mail_send'));
+ $err->add($i18n->get('error.mail_send'));
}
}
}
}
-$smarty->assign('title', $i18n->getKey('title.send_report'));
+$smarty->assign('title', $i18n->get('title.send_report'));
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"');
$smarty->assign('content_page_name', 'mail.tpl');
'style'=>'width: 250px;',
'data'=>$report_list,
'datakeys'=>array('id','name'),
- 'empty'=>array('-1'=>$i18n->getKey('dropdown.no'))));
+ 'empty'=>array('-1'=>$i18n->get('dropdown.no'))));
$form->addInput(array('type'=>'hidden','name'=>'fav_report_changed'));
// Generate and Delete buttons.
-$form->addInput(array('type'=>'submit','name'=>'btn_generate','value'=>$i18n->getKey('button.generate')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete'),'onclick'=>"return confirm('".$i18n->getKey('form.reports.confirm_delete')."')"));
+$form->addInput(array('type'=>'submit','name'=>'btn_generate','value'=>$i18n->get('button.generate')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'),'onclick'=>"return confirm('".$i18n->get('form.reports.confirm_delete')."')"));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)) {
'style'=>'width: 250px;',
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))));
}
// If we have a TYPE_DROPDOWN custom field - add control to select an option.
'style'=>'width: 250px;',
'value'=>$cl_cf_1,
'data'=>$custom_fields->options,
- 'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))));
}
// Add controls for projects and tasks.
'style'=>'width: 250px;',
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))));
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
$task_list = ttTeamHelper::getActiveTasks($user->team_id);
$form->addInput(array('type'=>'combobox',
'style'=>'width: 250px;',
'data'=>$task_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))));
}
// Add include records control.
-$include_options = array('1'=>$i18n->getKey('form.reports.include_billable'),
- '2'=>$i18n->getKey('form.reports.include_not_billable'));
+$include_options = array('1'=>$i18n->get('form.reports.include_billable'),
+ '2'=>$i18n->get('form.reports.include_not_billable'));
$form->addInput(array('type'=>'combobox',
'name'=>'include_records',
'style'=>'width: 250px;',
'data'=>$include_options,
- 'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))));
if ($user->canManageTeam() && $user->isPluginEnabled('ps')) {
$form->addInput(array('type'=>'combobox',
'name'=>'paid_status',
'style'=>'width: 250px;',
- 'data'=>array('1'=>$i18n->getKey('dropdown.paid'),'2'=>$i18n->getKey('dropdown.not_paid')),
- 'empty'=>array(''=>$i18n->getKey('dropdown.all'))
+ 'data'=>array('1'=>$i18n->get('dropdown.paid'),'2'=>$i18n->get('dropdown.not_paid')),
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))
));
}
// Add invoiced / not invoiced selector.
-$invoice_options = array('1'=>$i18n->getKey('form.reports.include_invoiced'),
- '2'=>$i18n->getKey('form.reports.include_not_invoiced'));
+$invoice_options = array('1'=>$i18n->get('form.reports.include_invoiced'),
+ '2'=>$i18n->get('form.reports.include_not_invoiced'));
$form->addInput(array('type'=>'combobox',
'name'=>'invoice',
'style'=>'width: 250px;',
'data'=>$invoice_options,
- 'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.all'))));
$user_list = array();
if ($user->canManageTeam() || $user->isClient()) {
$form->addInput(array('type'=>'combobox',
'name'=>'period',
'style'=>'width: 250px;',
- 'data'=>array(INTERVAL_THIS_MONTH=>$i18n->getKey('dropdown.current_month'),
- INTERVAL_LAST_MONTH=>$i18n->getKey('dropdown.previous_month'),
- INTERVAL_THIS_WEEK=>$i18n->getKey('dropdown.current_week'),
- INTERVAL_LAST_WEEK=>$i18n->getKey('dropdown.previous_week'),
- INTERVAL_THIS_DAY=>$i18n->getKey('dropdown.current_day'),
- INTERVAL_LAST_DAY=>$i18n->getKey('dropdown.previous_day')),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'data'=>array(INTERVAL_THIS_MONTH=>$i18n->get('dropdown.current_month'),
+ INTERVAL_LAST_MONTH=>$i18n->get('dropdown.previous_month'),
+ INTERVAL_THIS_WEEK=>$i18n->get('dropdown.current_week'),
+ INTERVAL_LAST_WEEK=>$i18n->get('dropdown.previous_week'),
+ INTERVAL_THIS_DAY=>$i18n->get('dropdown.current_day'),
+ INTERVAL_LAST_DAY=>$i18n->get('dropdown.previous_day')),
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Add controls for start and end dates.
$form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'start_date'));
$form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'end_date'));
if ($custom_fields && $custom_fields->fields[0])
$form->addInput(array('type'=>'checkbox','name'=>'chcf_1'));
// Add group by control.
-$group_by_options['no_grouping'] = $i18n->getKey('form.reports.group_by_no');
-$group_by_options['date'] = $i18n->getKey('form.reports.group_by_date');
+$group_by_options['no_grouping'] = $i18n->get('form.reports.group_by_no');
+$group_by_options['date'] = $i18n->get('form.reports.group_by_date');
if ($user->canManageTeam() || $user->isClient())
- $group_by_options['user'] = $i18n->getKey('form.reports.group_by_user');
+ $group_by_options['user'] = $i18n->get('form.reports.group_by_user');
if ($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id))
- $group_by_options['client'] = $i18n->getKey('form.reports.group_by_client');
+ $group_by_options['client'] = $i18n->get('form.reports.group_by_client');
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
- $group_by_options['project'] = $i18n->getKey('form.reports.group_by_project');
+ $group_by_options['project'] = $i18n->get('form.reports.group_by_project');
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
- $group_by_options['task'] = $i18n->getKey('form.reports.group_by_task');
+ $group_by_options['task'] = $i18n->get('form.reports.group_by_task');
if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN) {
$group_by_options['cf_1'] = $custom_fields->fields[0]['label'];
}
// Add text field for a new favorite report name.
$form->addInput(array('type'=>'text','name'=>'new_fav_report','maxlength'=>'30','style'=>'width: 250px;'));
// Save button.
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_generate','value'=>$i18n->getKey('button.generate')));
+$form->addInput(array('type'=>'submit','name'=>'btn_generate','value'=>$i18n->get('button.generate')));
// Create a bean (which is a mechanism to remember form values in session).
$bean = new ActionForm('reportBean', $form, $request);
}
} elseif ($bean->getAttribute('btn_save')) {
// User clicked the Save button. We need to save form options as new favorite report.
- if (!ttValidString($bean->getAttribute('new_fav_report'))) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.reports.save_as_favorite'));
+ if (!ttValidString($bean->getAttribute('new_fav_report'))) $err->add($i18n->get('error.field'), $i18n->get('form.reports.save_as_favorite'));
if ($err->no()) {
$id = ttFavReportHelper::saveReport($user->id, $bean);
if (!$id)
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
if ($err->no()) {
$bean->setAttribute('favorite_report', $id);
$bean->saveBean();
$start_date = new DateAndTime($user->date_format, $bean->getAttribute('start_date'));
if ($start_date->isError() || !$bean->getAttribute('start_date'))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start_date'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.start_date'));
$end_date = new DateAndTime($user->date_format, $bean->getAttribute('end_date'));
if ($end_date->isError() || !$bean->getAttribute('end_date'))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.end_date'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.end_date'));
if ($start_date->compare($end_date) > 0)
- $err->add($i18n->getKey('error.interval'), $i18n->getKey('label.end_date'), $i18n->getKey('label.start_date'));
+ $err->add($i18n->get('error.interval'), $i18n->get('label.end_date'), $i18n->get('label.start_date'));
}
$bean->saveBean();
$smarty->assign('assigned_projects', $assigned_projects);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="handleCheckboxes()"');
-$smarty->assign('title', $i18n->getKey('title.reports'));
+$smarty->assign('title', $i18n->get('title.reports'));
$smarty->assign('content_page_name', 'reports.tpl');
$smarty->display('index.tpl');
$rank_data[] = $i;
}
$form->addInput(array('type'=>'combobox','name'=>'rank','data'=>$rank_data));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
$existing_role = ttRoleHelper::getRoleByRank($cl_rank, $user->team_id);
header('Location: roles.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.role_exists'));
+ $err->add($i18n->get('error.role_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.add_role'));
+$smarty->assign('title', $i18n->get('title.add_role'));
$smarty->assign('content_page_name', 'role_add.tpl');
$smarty->display('index.tpl');
$form = new Form('roleDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_role_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: roles.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} elseif ($request->getParameter('btn_cancel')) {
header('Location: roles.php');
exit();
$smarty->assign('role_to_delete', $role_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.taskDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_role'));
+$smarty->assign('title', $i18n->get('title.delete_role'));
$smarty->assign('content_page_name', 'role_delete.tpl');
$smarty->display('index.tpl');
}
$form->addInput(array('type'=>'combobox','name'=>'rank','data'=>$rank_data,'value'=>$cl_rank));
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
- 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive'))));
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
+ 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
// Multiple select controls for assigned and available rights.
$form->addInput(array('type'=>'combobox','name'=>'assigned_rights','style'=>'width: 250px;','multiple'=>true,'data'=>$assigned_rights));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('button.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('button.delete')));
$form->addInput(array('type'=>'combobox','name'=>'available_rights','style'=>'width: 250px;','multiple'=>true,'data'=>$available_rights));
-$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
+$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
if ($request->isPost()) {
if ($request->getParameter('btn_save')) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
$existing_role = ttRoleHelper::getRoleByName($cl_name);
header('Location: roles.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.object_exists'));
+ $err->add($i18n->get('error.object_exists'));
}
}
if ($request->getParameter('btn_delete') && $request->getParameter('assigned_rights')) {
header('Location: role_edit.php?id='.$role['id']);
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
if ($request->getParameter('btn_add') && $request->getParameter('available_rights')) {
$rights = $role['rights'];
header('Location: role_edit.php?id='.$role['id']);
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_role'));
+$smarty->assign('title', $i18n->get('title.edit_role'));
$smarty->assign('content_page_name', 'role_edit.tpl');
$smarty->display('index.tpl');
$smarty->assign('active_roles', ttTeamHelper::getActiveRolesForUser());
$smarty->assign('inactive_roles', ttTeamHelper::getInactiveRolesForUser());
-$smarty->assign('title', $i18n->getKey('title.roles'));
+$smarty->assign('title', $i18n->get('title.roles'));
$smarty->assign('content_page_name', 'roles.tpl');
$smarty->display('index.tpl');
$form = new Form('swapForm');
$form->addInput(array('type'=>'combobox','name'=>'swap_with','style'=>'width: 250px;','data'=>$users,'datakeys'=>array('id','name')));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
if ($request->isPost()) {
if (ttTeamHelper::swapRolesWith($cl_id)) {
header('Location: users.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.swap_roles'));
+$smarty->assign('title', $i18n->get('title.swap_roles'));
$smarty->assign('content_page_name', 'swap_roles.tpl');
$smarty->display('index.tpl');
$table->setInteractive(false);
$form->addInputElement($table);
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
// Submit.
if ($request->isPost()) {
}
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.time'));
+$smarty->assign('title', $i18n->get('title.time'));
$smarty->assign('content_page_name', 'table_test.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','style'=>'width: 250px;','value'=>$cl_name));
$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description));
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','layout'=>'H','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_projects));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.add')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.add')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if (!ttTaskHelper::getTaskByName($cl_name)) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.task_exists'));
+ $err->add($i18n->get('error.task_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.taskForm.name.focus()"');
-$smarty->assign('title', $i18n->getKey('title.add_task'));
+$smarty->assign('title', $i18n->get('title.add_task'));
$smarty->assign('content_page_name', 'task_add.tpl');
$smarty->display('index.tpl');
$form = new Form('taskDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_task_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} elseif ($request->getParameter('btn_cancel')) {
header('Location: tasks.php');
exit();
$smarty->assign('task_to_delete', $task_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.taskDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_task'));
+$smarty->assign('title', $i18n->get('title.delete_task'));
$smarty->assign('content_page_name', 'task_delete.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','style'=>'width: 250px;','value'=>$cl_name));
$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description));
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
- 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive'))));
+ 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','layout'=>'H','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_projects));
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->get('button.copy')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
- if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
if ($err->no()) {
if ($request->getParameter('btn_save')) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.task_exists'));
+ $err->add($i18n->get('error.task_exists'));
}
if ($request->getParameter('btn_copy')) {
header('Location: tasks.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.task_exists'));
+ $err->add($i18n->get('error.task_exists'));
}
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_task'));
+$smarty->assign('title', $i18n->get('title.edit_task'));
$smarty->assign('content_page_name', 'task_edit.tpl');
$smarty->display('index.tpl');
$smarty->assign('active_tasks', ttTeamHelper::getActiveTasks($user->team_id));
$smarty->assign('inactive_tasks', ttTeamHelper::getInactiveTasks($user->team_id));
-$smarty->assign('title', $i18n->getKey('title.tasks'));
+$smarty->assign('title', $i18n->get('title.tasks'));
$smarty->assign('content_page_name', 'tasks.tpl');
$smarty->display('index.tpl');
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
'value'=>$cl_task,
'data'=>$task_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
// Add other controls.
if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_submit click.
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.submit')));
// If we have custom fields - add controls for them.
if ($custom_fields && $custom_fields->fields[0]) {
'style'=>'width: 250px;',
'value'=>$cl_cf_1,
'data'=>$custom_fields->options,
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if ($custom_fields) {
- if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
+ if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
}
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
- if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ if (!$cl_task) $err->add($i18n->get('error.task'));
}
if (strlen($cl_duration) == 0) {
if ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.start'));
if ($cl_finish) {
if (!ttTimeHelper::isValidTime($cl_finish))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.finish'));
if (!ttTimeHelper::isValidInterval($cl_start, $cl_finish))
- $err->add($i18n->getKey('error.interval'), $i18n->getKey('label.finish'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.interval'), $i18n->get('label.finish'), $i18n->get('label.start'));
}
} else {
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.start'));
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.start'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.finish'));
}
if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.duration'));
}
} else {
if (false === ttTimeHelper::postedDurationToMinutes($cl_duration))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
}
- if (!ttValidString($cl_note, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.note'));
+ if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
// Finished validating user input.
// Prohibit creating entries in future.
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($selected_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Prohibit creating entries in locked range.
if ($user->isDateLocked($selected_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Prohibit creating another uncompleted record.
if ($err->no()) {
if (($not_completed_rec = ttTimeHelper::getUncompleted($user->getActiveUser())) && (($cl_finish == '') && ($cl_duration == '')))
- $err->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
+ $err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
}
// Prohibit creating an overlapping record.
if ($err->no()) {
if (ttTimeHelper::overlaps($user->getActiveUser(), $cl_date, $cl_start, $cl_finish))
- $err->add($i18n->getKey('error.overlap'));
+ $err->add($i18n->get('error.overlap'));
}
// Insert record.
header('Location: time.php');
exit();
}
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} elseif ($request->getParameter('btn_stop')) {
// Stop button pressed to finish an uncompleted record.
'note'=>$record['comment'],
'billable'=>$record['billable']));
if (!$res)
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else {
// Cannot complete, redirect for manual edit.
header('Location: time_edit.php?id='.$record_id);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
$smarty->assign('timestring', $selected_date->toString($user->date_format));
-$smarty->assign('title', $i18n->getKey('title.time'));
+$smarty->assign('title', $i18n->get('title.time'));
$smarty->assign('content_page_name', 'time.tpl');
$smarty->display('index.tpl');
$time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser());
// Prohibit deleting invoiced records.
-if ($time_rec['invoice_id']) die($i18n->getKey('error.sys'));
+if ($time_rec['invoice_id']) die($i18n->get('error.sys'));
// Escape comment for presentation.
$time_rec['comment'] = htmlspecialchars($time_rec['comment']);
$uncompleted = ($time_rec['duration'] == '0:00');
if ($user->isDateLocked($item_date) && !$uncompleted)
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
if ($err->no()) {
header('Location: time.php');
exit();
} else {
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
}
$form = new Form('timeRecordForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
-$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->get('button.cancel')));
$smarty->assign('time_rec', $time_rec);
$smarty->assign('forms', array($form->getName() => $form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.delete_time_record'));
+$smarty->assign('title', $i18n->get('title.delete_time_record'));
$smarty->assign('content_page_name', 'time_delete.tpl');
$smarty->display('index.tpl');
$time_rec = ttTimeHelper::getRecord($cl_id, $user->getActiveUser());
// Prohibit editing invoiced records.
-if ($time_rec['invoice_id']) die($i18n->getKey('error.sys'));
+if ($time_rec['invoice_id']) die($i18n->get('error.sys'));
$item_date = new DateAndTime(DB_DATEFORMAT, $time_rec['date']);
if (strlen($cl_start) > 0 && $cl_start == $cl_finish && $cl_duration == '0:00') {
$cl_finish = '';
$cl_duration = '';
- $msg->add($i18n->getKey('form.time_edit.uncompleted'));
+ $msg->add($i18n->get('form.time_edit.uncompleted'));
}
}
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
'value'=>$cl_task,
'data'=>$task_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
// Add other controls.
'style'=>'width: 250px;',
'value'=>$cl_cf_1,
'data'=>$custom_fields->options,
- 'empty' => array('' => $i18n->getKey('dropdown.select'))));
+ 'empty' => array('' => $i18n->get('dropdown.select'))));
}
}
// Hidden control for record id.
if ($user->canManageTeam() && $user->isPluginEnabled('ps'))
$form->addInput(array('type'=>'checkbox','name'=>'paid','value'=>$cl_paid));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save or btn_copy click.
-$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.copy')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.copy')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if ($custom_fields) {
- if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
+ if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
}
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
- if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ if (!$cl_task) $err->add($i18n->get('error.task'));
}
if (!$cl_duration) {
if ('0' == $cl_duration)
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
elseif ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.start'));
if ($cl_finish) {
if (!ttTimeHelper::isValidTime($cl_finish))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.finish'));
if (!ttTimeHelper::isValidInterval($cl_start, $cl_finish))
- $err->add($i18n->getKey('error.interval'), $i18n->getKey('label.finish'), $i18n->getKey('label.start'));
+ $err->add($i18n->get('error.interval'), $i18n->get('label.finish'), $i18n->get('label.start'));
}
} else {
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.start'));
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.finish'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.start'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.finish'));
}
if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
- $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.empty'), $i18n->get('label.duration'));
}
} else {
if (false === ttTimeHelper::postedDurationToMinutes($cl_duration))
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
}
- if (!ttValidDate($cl_date)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.date'));
- if (!ttValidString($cl_note, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.note'));
+ if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
+ if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
// Finished validating user input.
// This is a new date for the time record.
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($new_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Save record.
if ($err->no()) {
// 1) Prohibit saving locked entries in any form.
if ($user->isDateLocked($item_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// 2) Prohibit saving completed unlocked entries into locked range.
if ($err->no() && $user->isDateLocked($new_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// 3) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists.
$uncompleted = ($cl_finish == '' && $cl_duration == '');
$not_completed_rec = ttTimeHelper::getUncompleted($user->getActiveUser());
if ($not_completed_rec && ($time_rec['id'] <> $not_completed_rec['id'])) {
// We have another not completed record.
- $err->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
+ $err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
}
}
}
// Prohibit creating an overlapping record.
if ($err->no()) {
if (ttTimeHelper::overlaps($user->getActiveUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish, $cl_id))
- $err->add($i18n->getKey('error.overlap'));
+ $err->add($i18n->get('error.overlap'));
}
// Now, an update.
if ($err->no()) {
// 1) Prohibit saving into locked range.
if ($user->isDateLocked($new_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// 2) Prohibit saving uncompleted unlocked entries when another uncompleted entry exists.
$uncompleted = ($cl_finish == '' && $cl_duration == '');
$not_completed_rec = ttTimeHelper::getUncompleted($user->getActiveUser());
if ($not_completed_rec) {
// We have another not completed record.
- $err->add($i18n->getKey('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->getKey('error.goto_uncompleted')."</a>");
+ $err->add($i18n->get('error.uncompleted_exists')." <a href = 'time_edit.php?id=".$not_completed_rec['id']."'>".$i18n->get('error.goto_uncompleted')."</a>");
}
}
}
// Prohibit creating an overlapping record.
if ($err->no()) {
if (ttTimeHelper::overlaps($user->getActiveUser(), $new_date->toString(DB_DATEFORMAT), $cl_start, $cl_finish))
- $err->add($i18n->getKey('error.overlap'));
+ $err->add($i18n->get('error.overlap'));
}
// Now, a new insert.
header('Location: time.php?date='.$new_date->toString(DB_DATEFORMAT));
exit();
}
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
$smarty->assign('task_list', $task_list);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
-$smarty->assign('title', $i18n->getKey('title.edit_time_record'));
+$smarty->assign('title', $i18n->get('title.edit_time_record'));
$smarty->assign('content_page_name', 'time_edit.tpl');
$smarty->display('index.tpl');
$items = ttReportHelper::getItems($bean);
// Build a string to use as filename for the files being downloaded.
-$filename = strtolower($i18n->getKey('title.report')).'_'.$bean->mValues['start_date'].'_'.$bean->mValues['end_date'];
+$filename = strtolower($i18n->get('title.report')).'_'.$bean->mValues['start_date'].'_'.$bean->mValues['end_date'];
header('Pragma: public'); // This is needed for IE8 to download files over https.
header('Content-Type: text/html; charset=utf-8');
$group_by_header = $custom_fields->fields[0]['label'];
else {
$key = 'label.'.$group_by;
- $group_by_header = $i18n->getKey($key);
+ $group_by_header = $i18n->get($key);
}
// Print headers.
print '"'.$group_by_header.'"';
- if ($bean->getAttribute('chduration')) print ',"'.$i18n->getKey('label.duration').'"';
- if ($bean->getAttribute('chcost')) print ',"'.$i18n->getKey('label.cost').'"';
+ if ($bean->getAttribute('chduration')) print ',"'.$i18n->get('label.duration').'"';
+ if ($bean->getAttribute('chcost')) print ',"'.$i18n->get('label.cost').'"';
print "\n";
// Print subtotals.
}
} else {
// Normal report. Print headers.
- print '"'.$i18n->getKey('label.date').'"';
- if ($user->canManageTeam() || $user->isClient()) print ',"'.$i18n->getKey('label.user').'"';
- if ($bean->getAttribute('chclient')) print ',"'.$i18n->getKey('label.client').'"';
- if ($bean->getAttribute('chproject')) print ',"'.$i18n->getKey('label.project').'"';
- if ($bean->getAttribute('chtask')) print ',"'.$i18n->getKey('label.task').'"';
+ print '"'.$i18n->get('label.date').'"';
+ if ($user->canManageTeam() || $user->isClient()) print ',"'.$i18n->get('label.user').'"';
+ if ($bean->getAttribute('chclient')) print ',"'.$i18n->get('label.client').'"';
+ if ($bean->getAttribute('chproject')) print ',"'.$i18n->get('label.project').'"';
+ if ($bean->getAttribute('chtask')) print ',"'.$i18n->get('label.task').'"';
if ($bean->getAttribute('chcf_1')) print ',"'.$custom_fields->fields[0]['label'].'"';
- if ($bean->getAttribute('chstart')) print ',"'.$i18n->getKey('label.start').'"';
- if ($bean->getAttribute('chfinish')) print ',"'.$i18n->getKey('label.finish').'"';
- if ($bean->getAttribute('chduration')) print ',"'.$i18n->getKey('label.duration').'"';
- if ($bean->getAttribute('chnote')) print ',"'.$i18n->getKey('label.note').'"';
- if ($bean->getAttribute('chcost')) print ',"'.$i18n->getKey('label.cost').'"';
- if ($bean->getAttribute('chpaid')) print ',"'.$i18n->getKey('label.paid').'"';
- if ($bean->getAttribute('chip')) print ',"'.$i18n->getKey('label.ip').'"';
- if ($bean->getAttribute('chinvoice')) print ',"'.$i18n->getKey('label.invoice').'"';
+ if ($bean->getAttribute('chstart')) print ',"'.$i18n->get('label.start').'"';
+ if ($bean->getAttribute('chfinish')) print ',"'.$i18n->get('label.finish').'"';
+ if ($bean->getAttribute('chduration')) print ',"'.$i18n->get('label.duration').'"';
+ if ($bean->getAttribute('chnote')) print ',"'.$i18n->get('label.note').'"';
+ if ($bean->getAttribute('chcost')) print ',"'.$i18n->get('label.cost').'"';
+ if ($bean->getAttribute('chpaid')) print ',"'.$i18n->get('label.paid').'"';
+ if ($bean->getAttribute('chip')) print ',"'.$i18n->get('label.ip').'"';
+ if ($bean->getAttribute('chinvoice')) print ',"'.$i18n->get('label.invoice').'"';
print "\n";
// Print items.
$group_by_header = $custom_fields->fields[0]['label'];
else {
$key = 'label.'.$group_by;
- $group_by_header = $i18n->getKey($key);
+ $group_by_header = $i18n->get($key);
}
}
}
// Build a string to use as filename for the files being downloaded.
-$filename = strtolower($i18n->getKey('title.report')).'_'.$bean->mValues['start_date'].'_'.$bean->mValues['end_date'];
+$filename = strtolower($i18n->get('title.report')).'_'.$bean->mValues['start_date'].'_'.$bean->mValues['end_date'];
// Start preparing HTML to build PDF from.
$styleHeader = 'style="background-color:#a6ccf7;"';
$styleCentered = 'style="text-align:center;"';
$styleRightAligned = 'style="text-align:right;"';
-$title = $i18n->getKey('title.report').": ".$totals['start_date']." - ".$totals['end_date'];
+$title = $i18n->get('title.report').": ".$totals['start_date']." - ".$totals['end_date'];
$html = '<h1 style="text-align:center;">'.$title.'</h1>';
$html .= '<table border="1" cellpadding="3" cellspacing="0" width="100%">';
$html .= '<thead>';
$html .= "<tr $styleHeader>";
$html .= '<td>'.htmlspecialchars($group_by_header).'</td>';
- if ($bean->getAttribute('chduration')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.duration').'</td>'; }
- if ($bean->getAttribute('chcost')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.cost').'</td>'; }
+ if ($bean->getAttribute('chduration')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.duration').'</td>'; }
+ if ($bean->getAttribute('chcost')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.cost').'</td>'; }
$html .= '</tr>';
$html .= '</thead>';
// Print subtotals.
// Print totals.
$html .= '<tr><td colspan="'.$colspan.'"> </td></tr>';
$html .= "<tr $styleSubtotal>";
- $html .= '<td>'.$i18n->getKey('label.total').'</td>';
+ $html .= '<td>'.$i18n->get('label.total').'</td>';
if ($bean->getAttribute('chduration')) $html .= "<td $styleRightAligned>".$totals['time'].'</td>';
if ($bean->getAttribute('chcost')) {
$html .= "<td $styleRightAligned>";
// Table header.
$html .= '<thead>';
$html .= "<tr $styleHeader>";
- $html .= '<td>'.$i18n->getKey('label.date').'</td>';
- if ($user->canManageTeam() || $user->isClient()) { $colspan++; $html .= '<td>'.$i18n->getKey('label.user').'</td>'; }
- if ($bean->getAttribute('chclient')) { $colspan++; $html .= '<td>'.$i18n->getKey('label.client').'</td>'; }
- if ($bean->getAttribute('chproject')) { $colspan++; $html .= '<td>'.$i18n->getKey('label.project').'</td>'; }
- if ($bean->getAttribute('chtask')) { $colspan++; $html .= '<td>'.$i18n->getKey('label.task').'</td>'; }
+ $html .= '<td>'.$i18n->get('label.date').'</td>';
+ if ($user->canManageTeam() || $user->isClient()) { $colspan++; $html .= '<td>'.$i18n->get('label.user').'</td>'; }
+ if ($bean->getAttribute('chclient')) { $colspan++; $html .= '<td>'.$i18n->get('label.client').'</td>'; }
+ if ($bean->getAttribute('chproject')) { $colspan++; $html .= '<td>'.$i18n->get('label.project').'</td>'; }
+ if ($bean->getAttribute('chtask')) { $colspan++; $html .= '<td>'.$i18n->get('label.task').'</td>'; }
if ($bean->getAttribute('chcf_1')) { $colspan++; $html .= '<td>'.htmlspecialchars($custom_fields->fields[0]['label']).'</td>'; }
- if ($bean->getAttribute('chstart')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.start').'</td>'; }
- if ($bean->getAttribute('chfinish')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.finish').'</td>'; }
- if ($bean->getAttribute('chduration')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.duration').'</td>'; }
- if ($bean->getAttribute('chnote')) { $colspan++; $html .= '<td>'.$i18n->getKey('label.note').'</td>'; }
- if ($bean->getAttribute('chcost')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.cost').'</td>'; }
- if ($bean->getAttribute('chpaid')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.paid').'</td>'; }
- if ($bean->getAttribute('chip')) { $colspan++; $html .= "<td $styleCentered>".$i18n->getKey('label.ip').'</td>'; }
- if ($bean->getAttribute('chinvoice')) { $colspan++; $html .= '<td>'.$i18n->getKey('label.invoice').'</td>'; }
+ if ($bean->getAttribute('chstart')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.start').'</td>'; }
+ if ($bean->getAttribute('chfinish')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.finish').'</td>'; }
+ if ($bean->getAttribute('chduration')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.duration').'</td>'; }
+ if ($bean->getAttribute('chnote')) { $colspan++; $html .= '<td>'.$i18n->get('label.note').'</td>'; }
+ if ($bean->getAttribute('chcost')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.cost').'</td>'; }
+ if ($bean->getAttribute('chpaid')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.paid').'</td>'; }
+ if ($bean->getAttribute('chip')) { $colspan++; $html .= "<td $styleCentered>".$i18n->get('label.ip').'</td>'; }
+ if ($bean->getAttribute('chinvoice')) { $colspan++; $html .= '<td>'.$i18n->get('label.invoice').'</td>'; }
$html .= '</tr>';
$html .= '</thead>';
$cur_grouped_by = $item['grouped_by'];
if ($cur_grouped_by != $prev_grouped_by && !$first_pass) {
$html .= '<tr style="background-color:#e0e0e0;">';
- $html .= '<td>'.$i18n->getKey('label.subtotal').'</td>';
+ $html .= '<td>'.$i18n->get('label.subtotal').'</td>';
if ($user->canManageTeam() || $user->isClient()) {
$html .= '<td>';
if ($group_by == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
}
if ($bean->getAttribute('chpaid')) {
$html .= '<td>';
- $html .= $item['paid'] == 1 ? $i18n->getKey('label.yes') : $i18n->getKey('label.no');
+ $html .= $item['paid'] == 1 ? $i18n->get('label.yes') : $i18n->get('label.no');
$html .= '</td>';
}
if ($bean->getAttribute('chip')) {
// Print a terminating subtotal.
if ($print_subtotals) {
$html .= '<tr style="background-color:#e0e0e0;">';
- $html .= '<td>'.$i18n->getKey('label.subtotal').'</td>';
+ $html .= '<td>'.$i18n->get('label.subtotal').'</td>';
if ($user->canManageTeam() || $user->isClient()) {
$html .= '<td>';
if ($group_by == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
// Print totals.
$html .= '<tr><td colspan="'.$colspan.'"> </td></tr>';
$html .= '<tr style="background-color:#e0e0e0;">';
- $html .= '<td>'.$i18n->getKey('label.total').'</td>';
+ $html .= '<td>'.$i18n->get('label.total').'</td>';
if ($user->canManageTeam() || $user->isClient()) $html .= '<td></td>';
if ($bean->getAttribute('chclient')) $html .= '<td></td>';
if ($bean->getAttribute('chproject')) $html .= '<td></td>';
// Output footer.
if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) // By default we print it unless explicitely defined as false.
- $html .= '<p style="text-align: center;">'.$i18n->getKey('form.mail.footer').'</p>';
+ $html .= '<p style="text-align: center;">'.$i18n->get('form.mail.footer').'</p>';
// By this time we have html ready.
// Determine title for report.
-$title = $i18n->getKey('title.report').": ".$totals['start_date']." - ".$totals['end_date'];
+$title = $i18n->get('title.report').": ".$totals['start_date']." - ".$totals['end_date'];
header('Pragma: public'); // This is needed for IE8 to download files over https.
header('Content-Type: text/html; charset=utf-8');
$pdf->SetImageFile('images/'.$user->team_id.'.png');
// Set page word for the footer.
-$pdf->SetPageWord($i18n->getKey('label.page'));
+$pdf->SetPageWord($i18n->get('label.page'));
// Set document information.
$pdf->SetCreator(PDF_CREATOR);
$project_with_rate['rate'] = $request->getParameter('rate_'.$p);
$assigned_projects[] = $project_with_rate;
} else
- $err->add($i18n->getKey('error.field'), 'rate_'.$p);
+ $err->add($i18n->get('error.field'), 'rate_'.$p);
}
}
}
$active_roles = ttTeamHelper::getActiveRolesForUser();
$form->addInput(array('type'=>'combobox','onchange'=>'handleClientControl()','name'=>'role','value'=>$cl_role_id,'data'=>$active_roles,'datakeys'=>array('id', 'name')));
if ($user->isPluginEnabled('cl'))
- $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'rate','format'=>'.2','value'=>$cl_rate));
$table->setData($projects);
$table->setKeyField('id');
$table->setValue($cl_projects);
-$table->addColumn(new TableColumn('name', $i18n->getKey('label.project'), new NameCellRenderer()));
-$table->addColumn(new TableColumn('p_rate', $i18n->getKey('form.users.rate'), new RateCellRenderer()));
+$table->addColumn(new TableColumn('name', $i18n->get('label.project'), new NameCellRenderer()));
+$table->addColumn(new TableColumn('p_rate', $i18n->get('form.users.rate'), new RateCellRenderer()));
$form->addInputElement($table);
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.person_name'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
if (!$auth->isPasswordExternal()) {
- if (!ttValidString($cl_password1)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
- if (!ttValidString($cl_password2)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.confirm_password'));
+ if (!ttValidString($cl_password1)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
+ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password'));
if ($cl_password1 !== $cl_password2)
- $err->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password'));
+ $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password'));
}
- if (!ttValidEmail($cl_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
+ if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
// Require selection of a client for a client role.
- if ($user->isPluginEnabled('cl') && ttRoleHelper::isClientRole($cl_role_id) && !$cl_client_id) $err->add($i18n->getKey('error.client'));
- if (!ttValidFloat($cl_rate, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.users.default_rate'));
+ if ($user->isPluginEnabled('cl') && ttRoleHelper::isClientRole($cl_role_id) && !$cl_client_id) $err->add($i18n->get('error.client'));
+ if (!ttValidFloat($cl_rate, true)) $err->add($i18n->get('error.field'), $i18n->get('form.users.default_rate'));
if ($err->no()) {
if (!ttUserHelper::getUserByLogin($cl_login)) {
header('Location: users.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.user_exists'));
+ $err->add($i18n->get('error.user_exists'));
}
} // isPost
$smarty->assign('active_roles', $active_roles);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"');
-$smarty->assign('title', $i18n->getKey('title.add_user'));
+$smarty->assign('title', $i18n->get('title.add_user'));
$smarty->assign('content_page_name', 'user_add.tpl');
$smarty->display('index.tpl');
// Create confirmation form.
$form = new Form('userDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$user_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
}
exit();
} else {
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
if ($request->getParameter('btn_cancel')) {
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.delete_user'));
+$smarty->assign('title', $i18n->get('title.delete_user'));
$smarty->assign('content_page_name', 'user_delete.tpl');
$smarty->display('index.tpl');
$project_with_rate['rate'] = $request->getParameter('rate_'.$p);
$assigned_projects[] = $project_with_rate;
} else
- $err->add($i18n->getKey('error.field'), 'rate_'.$p);
+ $err->add($i18n->get('error.field'), 'rate_'.$p);
}
}
} else {
$active_roles = ttTeamHelper::getActiveRolesForUser();
$form->addInput(array('type'=>'combobox','onchange'=>'handleClientControl()','name'=>'role','value'=>$cl_role_id,'data'=>$active_roles, 'datakeys'=>array('id', 'name')));
if ($user->isPluginEnabled('cl'))
- $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
- 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive'))));
+ 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'rate','format'=>'.2','value'=>$cl_rate));
// Define classes for the projects table.
$table->setData($projects);
$table->setKeyField('id');
$table->setValue($cl_projects);
-$table->addColumn(new TableColumn('name', $i18n->getKey('label.project'), new NameCellRenderer()));
-$table->addColumn(new TableColumn('p_rate', $i18n->getKey('form.users.rate'), new RateCellRenderer()));
+$table->addColumn(new TableColumn('name', $i18n->get('label.project'), new NameCellRenderer()));
+$table->addColumn(new TableColumn('p_rate', $i18n->get('form.users.rate'), new RateCellRenderer()));
$form->addInputElement($table);
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$user_id));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.save')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.person_name'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
if (!$auth->isPasswordExternal() && ($cl_password1 || $cl_password2)) {
- if (!ttValidString($cl_password1)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
- if (!ttValidString($cl_password2)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.confirm_password'));
+ if (!ttValidString($cl_password1)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
+ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password'));
if ($cl_password1 !== $cl_password2)
- $err->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password'));
+ $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password'));
}
- if (!ttValidEmail($cl_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
+ if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
// Require selection of a client for a client role.
- if ($user->isPluginEnabled('cl') && ttRoleHelper::isClientRole($cl_role_id) && !$cl_client_id) $err->add($i18n->getKey('error.client'));
- if (!ttValidFloat($cl_rate, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.users.default_rate'));
+ if ($user->isPluginEnabled('cl') && ttRoleHelper::isClientRole($cl_role_id) && !$cl_client_id) $err->add($i18n->get('error.client'));
+ if (!ttValidFloat($cl_rate, true)) $err->add($i18n->get('error.field'), $i18n->get('form.users.default_rate'));
if ($err->no()) {
$existing_user = ttUserHelper::getUserByLogin($cl_login);
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.user_exists'));
+ $err->add($i18n->get('error.user_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"');
$smarty->assign('user_id', $user_id);
-$smarty->assign('title', $i18n->getKey('title.edit_user'));
+$smarty->assign('title', $i18n->get('title.edit_user'));
$smarty->assign('content_page_name', 'user_edit.tpl');
$smarty->display('index.tpl');
$smarty->assign('active_users', $active_users);
$smarty->assign('inactive_users', $inactive_users);
$smarty->assign('can_delete_manager', $can_delete_manager);
-$smarty->assign('title', $i18n->getKey('title.users'));
+$smarty->assign('title', $i18n->get('title.users'));
$smarty->assign('content_page_name', 'users.tpl');
$smarty->display('index.tpl');
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
'value'=>$cl_task,
'data'=>$task_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
if (!defined('NOTE_INPUT_HEIGHT'))
define('NOTE_INPUT_HEIGHT', 40);
if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'get_date()')); // User current date, which gets filled in on btn_submit click.
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.submit')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.submit')));
// If we have custom fields - add controls for them.
if ($custom_fields && $custom_fields->fields[0]) {
'style'=>'width: 250px;',
'value'=>$cl_cf_1,
'data'=>$custom_fields->options,
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
}
if ($newEntryPosted) {
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if ($custom_fields) {
- if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
+ if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
}
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
- if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ if (!$cl_task) $err->add($i18n->get('error.task'));
}
}
// Finished validating user input for row 0.
// If posted value is not null, check and normalize it.
if ($postedDuration) {
if (false === ttTimeHelper::postedDurationToMinutes($postedDuration)) {
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.duration'));
$result = false; break; // Break out. Stop any further processing.
} else {
$minutes = ttTimeHelper::postedDurationToMinutes($postedDuration);
$existingComment = $dataArray[$rowNumber][$dayHeader]['note'];
// If posted value is not null, check it.
if ($postedComment && !ttValidString($postedComment, true)) {
- $err->add($i18n->getKey('error.field'), $i18n->getKey('label.note'));
+ $err->add($i18n->get('error.field'), $i18n->get('label.note'));
$result = false; break; // Break out. Stop any further processing.
}
// Do not process if value has not changed.
$smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format));
$smarty->assign('time_records', $records);
-$smarty->assign('title', $i18n->getKey('title.time'));
+$smarty->assign('title', $i18n->get('title.time'));
$smarty->assign('content_page_name', 'week.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'checkbox','name'=>'week_note','value'=>$cl_week_note));
$form->addInput(array('type'=>'checkbox','name'=>'week_list','value'=>$cl_week_list));
$form->addInput(array('type'=>'checkbox','name'=>'notes','value'=>$cl_notes));
-$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
if ($request->isPost()){
if (!ttTeamHelper::enablePlugin('wvn', $cl_week_note) ||
!ttTeamHelper::enablePlugin('wvl', $cl_week_list) ||
!ttTeamHelper::enablePlugin('wvns', $cl_notes)) {
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.week_view'));
+$smarty->assign('title', $i18n->get('title.week_view'));
$smarty->assign('content_page_name', 'week_view.tpl');
$smarty->display('index.tpl');