From fd0872d9e582113346fa1e93557f370286c5c9f2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 23 Mar 2018 17:01:42 +0000 Subject: [PATCH] Replaced getKey() with get() calls. --- WEB-INF/lib/I18n.class.php | 5 --- WEB-INF/templates/footer.tpl | 2 +- mobile/expense_delete.php | 12 +++--- mobile/expense_edit.php | 38 +++++++++--------- mobile/expenses.php | 26 ++++++------- mobile/login.php | 12 +++--- mobile/project_add.php | 12 +++--- mobile/project_delete.php | 10 ++--- mobile/project_edit.php | 22 +++++------ mobile/projects.php | 2 +- mobile/task_add.php | 12 +++--- mobile/task_delete.php | 10 ++--- mobile/task_edit.php | 22 +++++------ mobile/tasks.php | 2 +- mobile/time.php | 48 +++++++++++------------ mobile/time_delete.php | 12 +++--- mobile/time_edit.php | 58 ++++++++++++++-------------- mobile/timer.php | 36 +++++++++--------- mobile/user_add.php | 30 +++++++-------- mobile/user_delete.php | 8 ++-- mobile/user_edit.php | 34 ++++++++--------- mobile/users.php | 2 +- notification_add.php | 20 +++++----- notification_delete.php | 10 ++--- notification_edit.php | 20 +++++----- notifications.php | 4 +- password_change.php | 12 +++--- password_reset.php | 18 ++++----- predefined_expense_add.php | 10 ++--- predefined_expense_delete.php | 10 ++--- predefined_expense_edit.php | 10 ++--- predefined_expenses.php | 4 +- profile_edit.php | 42 ++++++++++---------- project_add.php | 12 +++--- project_delete.php | 10 ++--- project_edit.php | 20 +++++----- projects.php | 2 +- quotas.php | 10 ++--- register.php | 4 +- report.php | 18 ++++----- report_send.php | 18 ++++----- reports.php | 72 +++++++++++++++++------------------ role_add.php | 12 +++--- role_delete.php | 10 ++--- role_edit.php | 22 +++++------ roles.php | 2 +- swap_roles.php | 6 +-- table_test.php | 4 +- task_add.php | 12 +++--- task_delete.php | 10 ++--- task_edit.php | 20 +++++----- tasks.php | 2 +- time.php | 50 ++++++++++++------------ time_delete.php | 12 +++--- time_edit.php | 68 ++++++++++++++++----------------- tofile.php | 34 ++++++++--------- topdf.php | 52 ++++++++++++------------- user_add.php | 32 ++++++++-------- user_delete.php | 8 ++-- user_edit.php | 34 ++++++++--------- users.php | 2 +- week.php | 26 ++++++------- week_view.php | 6 +-- 63 files changed, 580 insertions(+), 585 deletions(-) diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index ed7497d7..0e3dd02a 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -52,11 +52,6 @@ class I18n { 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; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 7cf8ef60..21c30273 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.67.4144 | Copyright © Anuko | +  Anuko Time Tracker 1.17.67.4145 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/mobile/expense_delete.php b/mobile/expense_delete.php index da902b4f..48051b42 100644 --- a/mobile/expense_delete.php +++ b/mobile/expense_delete.php @@ -41,7 +41,7 @@ $cl_id = $request->getParameter('id'); $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. @@ -49,7 +49,7 @@ if ($request->isPost()) { // 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. @@ -57,7 +57,7 @@ if ($request->isPost()) { 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. @@ -68,11 +68,11 @@ if ($request->isPost()) { $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'); diff --git a/mobile/expense_edit.php b/mobile/expense_edit.php index fff249e7..7107e785 100644 --- a/mobile/expense_edit.php +++ b/mobile/expense_edit.php @@ -44,7 +44,7 @@ $cl_id = $request->getParameter('id'); $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']); @@ -77,7 +77,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -90,7 +90,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -116,7 +116,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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. @@ -129,7 +129,7 @@ if ($predefined_expenses) { '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)); @@ -138,20 +138,20 @@ $form->addInput(array('type'=>'datefield','name'=>'date','maxlength'=>'20','valu // 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); @@ -160,7 +160,7 @@ if ($request->isPost()) { 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. @@ -172,11 +172,11 @@ if ($request->isPost()) { // 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()) { @@ -192,7 +192,7 @@ if ($request->isPost()) { 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()) { @@ -201,7 +201,7 @@ if ($request->isPost()) { header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT)); exit(); } else - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } @@ -216,6 +216,6 @@ $smarty->assign('client_list', $client_list); $smarty->assign('project_list', $project_list); $smarty->assign('task_list', $task_list); $smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->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'); diff --git a/mobile/expenses.php b/mobile/expenses.php index 40b3a342..934c63a7 100644 --- a/mobile/expenses.php +++ b/mobile/expenses.php @@ -88,7 +88,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -102,7 +102,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -128,7 +128,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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. @@ -141,38 +141,38 @@ if ($predefined_expenses) { '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()) { @@ -181,7 +181,7 @@ if ($request->isPost()) { 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()) { @@ -207,6 +207,6 @@ $smarty->assign('client_list', $client_list); $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'); diff --git a/mobile/login.php b/mobile/login.php index 384cf8c7..4d1412d3 100644 --- a/mobile/login.php +++ b/mobile/login.php @@ -42,12 +42,12 @@ $form = new Form('loginForm'); $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()) { @@ -76,12 +76,12 @@ if ($request->isPost()) { } 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']); @@ -89,6 +89,6 @@ $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'); diff --git a/mobile/project_add.php b/mobile/project_add.php index f7dc3fbf..bbaa8fa7 100644 --- a/mobile/project_add.php +++ b/mobile/project_add.php @@ -63,12 +63,12 @@ $form->addInput(array('type'=>'textarea','name'=>'description','class'=>'mobile- $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)) { @@ -82,14 +82,14 @@ if ($request->isPost()) { 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'); diff --git a/mobile/project_delete.php b/mobile/project_delete.php index 6e57f4d4..d2b0b32b 100644 --- a/mobile/project_delete.php +++ b/mobile/project_delete.php @@ -42,8 +42,8 @@ $project_to_delete = $project['name']; $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')) { @@ -52,9 +52,9 @@ if ($request->isPost()) { 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(); @@ -64,6 +64,6 @@ if ($request->isPost()) { $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'); diff --git a/mobile/project_edit.php b/mobile/project_edit.php index 4c84c7c5..31ea65da 100644 --- a/mobile/project_edit.php +++ b/mobile/project_edit.php @@ -75,18 +75,18 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_project_id)); $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')) { @@ -103,9 +103,9 @@ if ($request->isPost()) { 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')) { @@ -120,9 +120,9 @@ if ($request->isPost()) { 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')) { @@ -134,6 +134,6 @@ if ($request->isPost()) { $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'); diff --git a/mobile/projects.php b/mobile/projects.php index a6aa0448..5dec7ee3 100644 --- a/mobile/projects.php +++ b/mobile/projects.php @@ -44,6 +44,6 @@ if($user->canManageTeam()) { $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'); diff --git a/mobile/task_add.php b/mobile/task_add.php index b413002b..0c405b6f 100644 --- a/mobile/task_add.php +++ b/mobile/task_add.php @@ -53,12 +53,12 @@ $form = new Form('taskForm'); $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)) { @@ -71,14 +71,14 @@ if ($request->isPost()) { 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'); diff --git a/mobile/task_delete.php b/mobile/task_delete.php index 4b6b149d..df3c964a 100644 --- a/mobile/task_delete.php +++ b/mobile/task_delete.php @@ -42,8 +42,8 @@ $task_to_delete = $task['name']; $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')) { @@ -52,9 +52,9 @@ if ($request->isPost()) { 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(); @@ -64,6 +64,6 @@ if ($request->isPost()) { $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'); diff --git a/mobile/task_edit.php b/mobile/task_edit.php index c4bc9d33..2ba2cc55 100644 --- a/mobile/task_edit.php +++ b/mobile/task_edit.php @@ -61,17 +61,17 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_task_id)); $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')) { @@ -87,9 +87,9 @@ if ($request->isPost()) { 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')) { @@ -103,9 +103,9 @@ if ($request->isPost()) { 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')) { @@ -116,6 +116,6 @@ if ($request->isPost()) { } // 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'); diff --git a/mobile/tasks.php b/mobile/tasks.php index 1e8b40a7..25575eb6 100644 --- a/mobile/tasks.php +++ b/mobile/tasks.php @@ -38,6 +38,6 @@ if (!ttAccessAllowed('manage_tasks') || MODE_PROJECTS_AND_TASKS != $user->tracki $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'); diff --git a/mobile/time.php b/mobile/time.php index fc1f68ff..abde5e01 100644 --- a/mobile/time.php +++ b/mobile/time.php @@ -97,7 +97,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -111,7 +111,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -138,7 +138,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); + 'empty'=>array(''=>$i18n->get('dropdown.select')))); } } @@ -150,7 +150,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { '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');")); @@ -167,7 +167,7 @@ $form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; 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]) { @@ -179,7 +179,7 @@ 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')))); } } @@ -189,62 +189,62 @@ 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 (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')." ".$i18n->getKey('error.goto_uncompleted').""); + $err->add($i18n->get('error.uncompleted_exists')." ".$i18n->get('error.goto_uncompleted').""); } // 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()) { @@ -273,7 +273,7 @@ if ($request->isPost()) { header('Location: time.php'); exit(); } - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } } // isPost @@ -288,6 +288,6 @@ $smarty->assign('task_list', $task_list); $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'); diff --git a/mobile/time_delete.php b/mobile/time_delete.php index 63884d23..33ba6146 100644 --- a/mobile/time_delete.php +++ b/mobile/time_delete.php @@ -42,7 +42,7 @@ $cl_id = $request->getParameter('id'); $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']); @@ -57,7 +57,7 @@ if ($request->isPost()) { $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()) { @@ -68,7 +68,7 @@ if ($request->isPost()) { header('Location: time.php'); exit(); } else { - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } } @@ -80,10 +80,10 @@ if ($request->isPost()) { $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'); diff --git a/mobile/time_edit.php b/mobile/time_edit.php index 6ec41def..683bab74 100644 --- a/mobile/time_edit.php +++ b/mobile/time_edit.php @@ -53,7 +53,7 @@ $cl_id = $request->getParameter('id'); $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']); @@ -98,7 +98,7 @@ if ($request->isPost()) { 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')); } } @@ -115,7 +115,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -129,7 +129,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -156,7 +156,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); + 'empty'=>array(''=>$i18n->get('dropdown.select')))); } } @@ -168,7 +168,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { '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. @@ -196,7 +196,7 @@ 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')))); } } // Hidden control for record id. @@ -204,49 +204,49 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_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. @@ -256,7 +256,7 @@ if ($request->isPost()) { 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. @@ -270,11 +270,11 @@ if ($request->isPost()) { 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 == ''); @@ -282,7 +282,7 @@ if ($request->isPost()) { $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')." ".$i18n->getKey('error.goto_uncompleted').""); + $err->add($i18n->get('error.uncompleted_exists')." ".$i18n->get('error.goto_uncompleted').""); } } } @@ -290,7 +290,7 @@ if ($request->isPost()) { // 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. @@ -334,6 +334,6 @@ $smarty->assign('project_list', $project_list); $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'); diff --git a/mobile/timer.php b/mobile/timer.php index 6851052f..059767ed 100644 --- a/mobile/timer.php +++ b/mobile/timer.php @@ -97,7 +97,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -112,7 +112,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -139,7 +139,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); + 'empty'=>array(''=>$i18n->get('dropdown.select')))); } } @@ -152,7 +152,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { '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)); @@ -160,9 +160,9 @@ $form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // $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]) { @@ -174,7 +174,7 @@ 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')) )); } } @@ -187,15 +187,15 @@ 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) { - if (!$cl_task) $err->add($i18n->getKey('error.task')); + if (!$cl_task) $err->add($i18n->get('error.task')); } // Finished validating user input. @@ -203,22 +203,22 @@ if ($request->isPost()) { 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')." ".$i18n->getKey('error.goto_uncompleted').""); + $err->add($i18n->get('error.uncompleted_exists')." ".$i18n->get('error.goto_uncompleted').""); } // 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()) { @@ -247,7 +247,7 @@ if ($request->isPost()) { header('Location: timer.php'); exit(); } - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } if ($request->getParameter('btn_stop')) { @@ -272,7 +272,7 @@ if ($request->isPost()) { 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']); @@ -296,6 +296,6 @@ $smarty->assign('task_list', $task_list); $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'); diff --git a/mobile/user_add.php b/mobile/user_add.php index 7fff9a06..838981de 100644 --- a/mobile/user_add.php +++ b/mobile/user_add.php @@ -67,7 +67,7 @@ if ($request->isPost()) { $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); } } } @@ -84,7 +84,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','value'= $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)); @@ -120,24 +120,24 @@ $table->setRowOptions(array('valign'=>'top','class'=>'tableHeader')); $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)) { @@ -155,9 +155,9 @@ if ($request->isPost()) { 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 @@ -165,6 +165,6 @@ $smarty->assign('auth_external', $auth->isPasswordExternal()); $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'); diff --git a/mobile/user_delete.php b/mobile/user_delete.php index cb0e1a2c..d8400456 100644 --- a/mobile/user_delete.php +++ b/mobile/user_delete.php @@ -58,8 +58,8 @@ $smarty->assign('user_to_delete', $user_details['name']." (".$user_details['logi // 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')) { @@ -82,7 +82,7 @@ if ($request->isPost()) { } exit(); } else { - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } if ($request->getParameter('btn_cancel')) { @@ -92,6 +92,6 @@ if ($request->isPost()) { } // 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'); diff --git a/mobile/user_edit.php b/mobile/user_edit.php index 89a473cb..285c3442 100644 --- a/mobile/user_edit.php +++ b/mobile/user_edit.php @@ -82,7 +82,7 @@ if ($request->isPost()) { $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 { @@ -112,10 +112,10 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','value'= $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. @@ -148,27 +148,27 @@ $table->setRowOptions(array('valign'=>'top','class'=>'tableHeader')); $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); @@ -214,9 +214,9 @@ if ($request->isPost()) { 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')); } } @@ -234,6 +234,6 @@ $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('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'); diff --git a/mobile/users.php b/mobile/users.php index 8ae0fc93..131d2b44 100644 --- a/mobile/users.php +++ b/mobile/users.php @@ -55,6 +55,6 @@ if ($user->uncompleted_indicators) { $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'); diff --git a/notification_add.php b/notification_add.php index 3cac6521..6d0e4d31 100644 --- a/notification_add.php +++ b/notification_add.php @@ -59,23 +59,23 @@ $form->addInput(array('type'=>'combobox', '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. @@ -94,11 +94,11 @@ if ($request->isPost()) { 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'); diff --git a/notification_delete.php b/notification_delete.php index 0b6cf5cc..46de065d 100644 --- a/notification_delete.php +++ b/notification_delete.php @@ -42,8 +42,8 @@ $notification_to_delete = $notification['name']; $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')) { @@ -52,9 +52,9 @@ if ($request->isPost()) { 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(); @@ -64,6 +64,6 @@ if ($request->isPost()) { $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'); diff --git a/notification_edit.php b/notification_edit.php index ec26f610..43179828 100644 --- a/notification_edit.php +++ b/notification_edit.php @@ -67,22 +67,22 @@ $form->addInput(array('type'=>'combobox', '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. @@ -102,11 +102,11 @@ if ($request->isPost()) { 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'); diff --git a/notifications.php b/notifications.php index 4205dffa..c03378d2 100644 --- a/notifications.php +++ b/notifications.php @@ -45,12 +45,12 @@ if ($request->isPost()) { 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'); diff --git a/password_change.php b/password_change.php index 89e79c7f..bcbd5f4a 100644 --- a/password_change.php +++ b/password_change.php @@ -62,14 +62,14 @@ $form = new Form('newPasswordForm'); $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. @@ -91,12 +91,12 @@ if ($request->isPost()) { } 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'); diff --git a/password_reset.php b/password_reset.php index e73dcf81..1ee4711e 100644 --- a/password_reset.php +++ b/password_reset.php @@ -38,13 +38,13 @@ if ($auth->isPasswordExternal()) { $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)) { @@ -55,9 +55,9 @@ if ($request->isPost()) { 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')); } } @@ -83,7 +83,7 @@ if ($request->isPost()) { if (ttValidEmail($cl_login)) $receiver = $cl_login; else - $err->add($i18n->getKey('error.no_email')); + $err->add($i18n->get('error.no_email')); } if ($receiver) { @@ -99,21 +99,21 @@ if ($request->isPost()) { 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'); diff --git a/predefined_expense_add.php b/predefined_expense_add.php index 5e730599..82cf99b6 100644 --- a/predefined_expense_add.php +++ b/predefined_expense_add.php @@ -44,12 +44,12 @@ if ($request->isPost()) { $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, @@ -58,11 +58,11 @@ if ($request->isPost()) { 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'); diff --git a/predefined_expense_delete.php b/predefined_expense_delete.php index 3b1cde55..c8ae1c82 100644 --- a/predefined_expense_delete.php +++ b/predefined_expense_delete.php @@ -42,8 +42,8 @@ $predefined_expense_to_delete = $predefined_expense['name']; $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')) { @@ -52,9 +52,9 @@ if ($request->isPost()) { 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(); @@ -64,6 +64,6 @@ if ($request->isPost()) { $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'); diff --git a/predefined_expense_edit.php b/predefined_expense_edit.php index 64bf9d84..220778a9 100644 --- a/predefined_expense_edit.php +++ b/predefined_expense_edit.php @@ -51,12 +51,12 @@ $form = new Form('predefinedExpenseForm'); $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, @@ -66,11 +66,11 @@ if ($request->isPost()) { 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'); diff --git a/predefined_expenses.php b/predefined_expenses.php index 9db98e0e..4e799121 100644 --- a/predefined_expenses.php +++ b/predefined_expenses.php @@ -45,12 +45,12 @@ if ($request->isPost()) { 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'); diff --git a/profile_edit.php b/profile_edit.php index ba157a9c..9c27ab41 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -165,8 +165,8 @@ if ($user->canManageTeam()) { $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);')); @@ -182,18 +182,18 @@ if ($user->canManageTeam()) { // 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. @@ -227,30 +227,30 @@ if ($user->canManageTeam()) { $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. @@ -338,13 +338,13 @@ if ($request->isPost()) { 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'); diff --git a/project_add.php b/project_add.php index 99f8c6d5..6b55019c 100644 --- a/project_add.php +++ b/project_add.php @@ -63,12 +63,12 @@ $form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: $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)) { @@ -82,14 +82,14 @@ if ($request->isPost()) { 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'); diff --git a/project_delete.php b/project_delete.php index a6b6ed53..683dbc50 100644 --- a/project_delete.php +++ b/project_delete.php @@ -42,8 +42,8 @@ $project_to_delete = $project['name']; $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')) { @@ -52,9 +52,9 @@ if ($request->isPost()) { 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(); @@ -64,6 +64,6 @@ if ($request->isPost()) { $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'); diff --git a/project_edit.php b/project_edit.php index d7b67565..be0e90fa 100644 --- a/project_edit.php +++ b/project_edit.php @@ -75,17 +75,17 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_project_id)); $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')) { @@ -102,9 +102,9 @@ if ($request->isPost()) { 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')) { @@ -119,15 +119,15 @@ if ($request->isPost()) { 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'); diff --git a/projects.php b/projects.php index ce7bb9a1..ed0103a4 100644 --- a/projects.php +++ b/projects.php @@ -44,6 +44,6 @@ if($user->canManageTeam()) { $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'); diff --git a/quotas.php b/quotas.php index 06fdbbe5..19e70e50 100644 --- a/quotas.php +++ b/quotas.php @@ -72,12 +72,12 @@ $quota = new MonthlyQuota(); 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. @@ -87,7 +87,7 @@ if ($request->isPost()){ $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. @@ -95,7 +95,7 @@ if ($request->isPost()){ 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()) { @@ -125,6 +125,6 @@ for ($i=0; $i < count($months); $i++) { $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'); diff --git a/register.php b/register.php index 3ddcb990..32fed57a 100644 --- a/register.php +++ b/register.php @@ -80,7 +80,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_login', $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. @@ -111,7 +111,7 @@ if ($request->isPost()) { } } // 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'); diff --git a/report.php b/report.php index c4bfd068..190dff8e 100644 --- a/report.php +++ b/report.php @@ -75,17 +75,17 @@ if ($bean->getAttribute('chpaid') || // 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); } @@ -94,7 +94,7 @@ if ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->g // 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, @@ -104,8 +104,8 @@ if ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->g '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); } } @@ -122,7 +122,7 @@ if ($request->isPost()) { 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. @@ -193,7 +193,7 @@ if ('no_grouping' != $group_by) { $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. @@ -207,6 +207,6 @@ $smarty->assign('report_items', $report_items); $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'); diff --git a/report_send.php b/report_send.php index 9be9676f..b420b3ac 100644 --- a/report_send.php +++ b/report_send.php @@ -48,7 +48,7 @@ if ($request->isPost()) { } 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'); @@ -56,14 +56,14 @@ $form->addInput(array('type'=>'text','name'=>'receiver','style'=>'width: 300px;' $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. @@ -87,9 +87,9 @@ if ($request->isPost()) { $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')); } } @@ -103,7 +103,7 @@ if (function_exists('imap_mime_header_decode')) { } } -$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'); diff --git a/reports.php b/reports.php index f6655d70..390c85c6 100644 --- a/reports.php +++ b/reports.php @@ -59,11 +59,11 @@ $form->addInput(array('type'=>'combobox', '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)) { @@ -76,7 +76,7 @@ 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. @@ -85,7 +85,7 @@ if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['ty '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. @@ -102,7 +102,7 @@ $form->addInput(array('type'=>'combobox', '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', @@ -110,36 +110,36 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { '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()) { @@ -171,13 +171,13 @@ 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')); @@ -206,16 +206,16 @@ $form->addInput(array('type'=>'checkbox','name'=>'chcost')); 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']; } @@ -225,9 +225,9 @@ $form->addInput(array('type'=>'checkbox','name'=>'chtotalsonly')); // 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); @@ -278,12 +278,12 @@ if ($request->isPost()) { } } 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(); @@ -310,14 +310,14 @@ if ($request->isPost()) { $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(); @@ -335,6 +335,6 @@ $smarty->assign('task_list', $task_list); $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'); diff --git a/role_add.php b/role_add.php index bd9f3e46..e4cbb964 100644 --- a/role_add.php +++ b/role_add.php @@ -50,12 +50,12 @@ for ($i = 0; $i < $user->rank; $i++) { $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); @@ -71,13 +71,13 @@ if ($request->isPost()) { 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'); diff --git a/role_delete.php b/role_delete.php index 7bf6ae69..086e7aff 100644 --- a/role_delete.php +++ b/role_delete.php @@ -42,8 +42,8 @@ $role_to_delete = $role['name']; $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')) { @@ -52,9 +52,9 @@ if ($request->isPost()) { 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(); @@ -64,6 +64,6 @@ if ($request->isPost()) { $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'); diff --git a/role_edit.php b/role_edit.php index 946f8347..3eb7696b 100644 --- a/role_edit.php +++ b/role_edit.php @@ -67,20 +67,20 @@ for ($i = 0; $i < $user->rank; $i++) { } $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); @@ -95,9 +95,9 @@ if ($request->isPost()) { 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')) { @@ -113,7 +113,7 @@ if ($request->isPost()) { 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']; @@ -132,11 +132,11 @@ if ($request->isPost()) { 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'); diff --git a/roles.php b/roles.php index 64a1ee4a..ec79020e 100644 --- a/roles.php +++ b/roles.php @@ -39,6 +39,6 @@ if (!ttAccessAllowed('manage_roles')) { $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'); diff --git a/swap_roles.php b/swap_roles.php index 5ee47248..0c525704 100644 --- a/swap_roles.php +++ b/swap_roles.php @@ -44,17 +44,17 @@ if ($request->isPost()) { $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'); diff --git a/table_test.php b/table_test.php index f8b4c725..7cd5cda3 100644 --- a/table_test.php +++ b/table_test.php @@ -104,7 +104,7 @@ $table->addColumn(new TableColumn('day_6', 'day 6', new TimeCellRenderer())); $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()) { @@ -113,6 +113,6 @@ 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'); diff --git a/task_add.php b/task_add.php index 40eb4887..12c54464 100644 --- a/task_add.php +++ b/task_add.php @@ -53,12 +53,12 @@ $form = new Form('taskForm'); $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)) { @@ -71,14 +71,14 @@ if ($request->isPost()) { 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'); diff --git a/task_delete.php b/task_delete.php index 3cdb5b69..d72220d2 100644 --- a/task_delete.php +++ b/task_delete.php @@ -42,8 +42,8 @@ $task_to_delete = $task['name']; $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')) { @@ -52,9 +52,9 @@ if ($request->isPost()) { 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(); @@ -64,6 +64,6 @@ if ($request->isPost()) { $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'); diff --git a/task_edit.php b/task_edit.php index 5c70f11b..36e717d7 100644 --- a/task_edit.php +++ b/task_edit.php @@ -61,15 +61,15 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_task_id)); $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')) { @@ -85,9 +85,9 @@ if ($request->isPost()) { 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')) { @@ -101,14 +101,14 @@ if ($request->isPost()) { 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'); diff --git a/tasks.php b/tasks.php index a1033a5c..5bc3fd45 100644 --- a/tasks.php +++ b/tasks.php @@ -38,6 +38,6 @@ if (!ttAccessAllowed('manage_tasks') || MODE_PROJECTS_AND_TASKS != $user->tracki $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'); diff --git a/time.php b/time.php index 7f9b1849..270a8aae 100644 --- a/time.php +++ b/time.php @@ -127,7 +127,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -141,7 +141,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -168,7 +168,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); + 'empty'=>array(''=>$i18n->get('dropdown.select')))); } } @@ -180,7 +180,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { '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. @@ -202,7 +202,7 @@ $form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // 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]) { @@ -214,7 +214,7 @@ 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')))); } } @@ -224,62 +224,62 @@ 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 (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')." ".$i18n->getKey('error.goto_uncompleted').""); + $err->add($i18n->get('error.uncompleted_exists')." ".$i18n->get('error.goto_uncompleted').""); } // 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. @@ -308,7 +308,7 @@ if ($request->isPost()) { 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. @@ -333,7 +333,7 @@ if ($request->isPost()) { '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); @@ -367,6 +367,6 @@ $smarty->assign('task_list', $task_list); $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'); diff --git a/time_delete.php b/time_delete.php index 0cdd8816..2ad3ea41 100644 --- a/time_delete.php +++ b/time_delete.php @@ -42,7 +42,7 @@ $cl_id = $request->getParameter('id'); $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']); @@ -57,7 +57,7 @@ if ($request->isPost()) { $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()) { @@ -68,7 +68,7 @@ if ($request->isPost()) { header('Location: time.php'); exit(); } else { - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } } @@ -80,11 +80,11 @@ if ($request->isPost()) { $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'); diff --git a/time_edit.php b/time_edit.php index 59ae7531..dd3edde1 100644 --- a/time_edit.php +++ b/time_edit.php @@ -53,7 +53,7 @@ $cl_id = $request->getParameter('id'); $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']); @@ -101,7 +101,7 @@ if ($request->isPost()) { 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')); } } @@ -118,7 +118,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -132,7 +132,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -159,7 +159,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); + 'empty'=>array(''=>$i18n->get('dropdown.select')))); } } @@ -171,7 +171,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { '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. @@ -199,7 +199,7 @@ 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')))); } } // Hidden control for record id. @@ -209,50 +209,50 @@ if ($user->isPluginEnabled('iv')) 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. @@ -262,7 +262,7 @@ if ($request->isPost()) { 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. @@ -276,11 +276,11 @@ if ($request->isPost()) { 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 == ''); @@ -288,7 +288,7 @@ if ($request->isPost()) { $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')." ".$i18n->getKey('error.goto_uncompleted').""); + $err->add($i18n->get('error.uncompleted_exists')." ".$i18n->get('error.goto_uncompleted').""); } } } @@ -296,7 +296,7 @@ if ($request->isPost()) { // 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. @@ -340,7 +340,7 @@ if ($request->isPost()) { 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 == ''); @@ -348,7 +348,7 @@ if ($request->isPost()) { $not_completed_rec = ttTimeHelper::getUncompleted($user->getActiveUser()); if ($not_completed_rec) { // We have another not completed record. - $err->add($i18n->getKey('error.uncompleted_exists')." ".$i18n->getKey('error.goto_uncompleted').""); + $err->add($i18n->get('error.uncompleted_exists')." ".$i18n->get('error.goto_uncompleted').""); } } } @@ -356,7 +356,7 @@ if ($request->isPost()) { // 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. @@ -387,7 +387,7 @@ if ($request->isPost()) { header('Location: time.php?date='.$new_date->toString(DB_DATEFORMAT)); exit(); } - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } @@ -402,6 +402,6 @@ $smarty->assign('project_list', $project_list); $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'); diff --git a/tofile.php b/tofile.php index 534cb943..67c5b31c 100644 --- a/tofile.php +++ b/tofile.php @@ -63,7 +63,7 @@ else $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'); @@ -164,13 +164,13 @@ if ('csv' == $type) { $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. @@ -192,20 +192,20 @@ if ('csv' == $type) { } } 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. diff --git a/topdf.php b/topdf.php index 68a1eb5c..b8f6684c 100644 --- a/topdf.php +++ b/topdf.php @@ -68,7 +68,7 @@ if ('no_grouping' != $group_by) { $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); } } @@ -88,7 +88,7 @@ if ($items && 'no_grouping' != $group_by) { } // 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;"'; @@ -96,7 +96,7 @@ $styleSubtotal = 'style="background-color:#e0e0e0;"'; $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 = '

'.$title.'

'; $html .= ''; @@ -107,8 +107,8 @@ if ($totals_only) { $html .= ''; $html .= ""; $html .= ''; - if ($bean->getAttribute('chduration')) { $colspan++; $html .= "'; } - if ($bean->getAttribute('chcost')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chduration')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chcost')) { $colspan++; $html .= "'; } $html .= ''; $html .= ''; // Print subtotals. @@ -129,7 +129,7 @@ if ($totals_only) { // Print totals. $html .= ''; $html .= ""; - $html .= ''; + $html .= ''; if ($bean->getAttribute('chduration')) $html .= "'; if ($bean->getAttribute('chcost')) { $html .= "'; $html .= ""; - $html .= ''; - if ($user->canManageTeam() || $user->isClient()) { $colspan++; $html .= ''; } - if ($bean->getAttribute('chclient')) { $colspan++; $html .= ''; } - if ($bean->getAttribute('chproject')) { $colspan++; $html .= ''; } - if ($bean->getAttribute('chtask')) { $colspan++; $html .= ''; } + $html .= ''; + if ($user->canManageTeam() || $user->isClient()) { $colspan++; $html .= ''; } + if ($bean->getAttribute('chclient')) { $colspan++; $html .= ''; } + if ($bean->getAttribute('chproject')) { $colspan++; $html .= ''; } + if ($bean->getAttribute('chtask')) { $colspan++; $html .= ''; } if ($bean->getAttribute('chcf_1')) { $colspan++; $html .= ''; } - if ($bean->getAttribute('chstart')) { $colspan++; $html .= "'; } - if ($bean->getAttribute('chfinish')) { $colspan++; $html .= "'; } - if ($bean->getAttribute('chduration')) { $colspan++; $html .= "'; } - if ($bean->getAttribute('chnote')) { $colspan++; $html .= ''; } - if ($bean->getAttribute('chcost')) { $colspan++; $html .= "'; } - if ($bean->getAttribute('chpaid')) { $colspan++; $html .= "'; } - if ($bean->getAttribute('chip')) { $colspan++; $html .= "'; } - if ($bean->getAttribute('chinvoice')) { $colspan++; $html .= ''; } + if ($bean->getAttribute('chstart')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chfinish')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chduration')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chnote')) { $colspan++; $html .= ''; } + if ($bean->getAttribute('chcost')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chpaid')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chip')) { $colspan++; $html .= "'; } + if ($bean->getAttribute('chinvoice')) { $colspan++; $html .= ''; } $html .= ''; $html .= ''; @@ -172,7 +172,7 @@ if ($totals_only) { $cur_grouped_by = $item['grouped_by']; if ($cur_grouped_by != $prev_grouped_by && !$first_pass) { $html .= ''; - $html .= ''; + $html .= ''; if ($user->canManageTeam() || $user->isClient()) { $html .= ''; } if ($bean->getAttribute('chip')) { @@ -259,7 +259,7 @@ if ($totals_only) { // Print a terminating subtotal. if ($print_subtotals) { $html .= ''; - $html .= ''; + $html .= ''; if ($user->canManageTeam() || $user->isClient()) { $html .= ''; $html .= ''; - $html .= ''; + $html .= ''; if ($user->canManageTeam() || $user->isClient()) $html .= ''; if ($bean->getAttribute('chclient')) $html .= ''; if ($bean->getAttribute('chproject')) $html .= ''; @@ -333,12 +333,12 @@ if ($totals_only) { // Output footer. if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) // By default we print it unless explicitely defined as false. - $html .= '

'.$i18n->getKey('form.mail.footer').'

'; + $html .= '

'.$i18n->get('form.mail.footer').'

'; // 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'); @@ -394,7 +394,7 @@ if (file_exists('images/'.$user->team_id.'.png')) $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); diff --git a/user_add.php b/user_add.php index a31669c7..91286537 100644 --- a/user_add.php +++ b/user_add.php @@ -68,7 +68,7 @@ if ($request->isPost()) { $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); } } } @@ -85,7 +85,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','value'= $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)); @@ -121,26 +121,26 @@ $table->setRowOptions(array('valign'=>'top','class'=>'tableHeader')); $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)) { @@ -158,9 +158,9 @@ if ($request->isPost()) { 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 @@ -168,6 +168,6 @@ $smarty->assign('auth_external', $auth->isPasswordExternal()); $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'); diff --git a/user_delete.php b/user_delete.php index 97b25572..a88454bf 100644 --- a/user_delete.php +++ b/user_delete.php @@ -57,8 +57,8 @@ $smarty->assign('user_to_delete', $user_details['name']." (".$user_details['logi // 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')) { @@ -81,7 +81,7 @@ if ($request->isPost()) { } exit(); } else { - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } } if ($request->getParameter('btn_cancel')) { @@ -91,6 +91,6 @@ if ($request->isPost()) { } // 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'); diff --git a/user_edit.php b/user_edit.php index ee572a7f..531e8424 100644 --- a/user_edit.php +++ b/user_edit.php @@ -83,7 +83,7 @@ if ($request->isPost()) { $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 { @@ -113,10 +113,10 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','style'= $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. @@ -150,27 +150,27 @@ $table->setRowOptions(array('valign'=>'top','class'=>'tableHeader')); $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); @@ -216,9 +216,9 @@ if ($request->isPost()) { 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 @@ -230,6 +230,6 @@ $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('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'); diff --git a/users.php b/users.php index 28a37227..86021863 100644 --- a/users.php +++ b/users.php @@ -56,6 +56,6 @@ if ($user->uncompleted_indicators) { $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'); diff --git a/week.php b/week.php index 29c15e47..e26aa119 100644 --- a/week.php +++ b/week.php @@ -235,7 +235,7 @@ if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { '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. } @@ -249,7 +249,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t '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')) { @@ -276,7 +276,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); + 'empty'=>array(''=>$i18n->get('dropdown.select')))); } } @@ -288,7 +288,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { '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); @@ -299,7 +299,7 @@ $form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // 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]) { @@ -311,7 +311,7 @@ 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')))); } } @@ -330,15 +330,15 @@ if ($request->isPost()) { } 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. @@ -369,7 +369,7 @@ if ($request->isPost()) { // 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); @@ -433,7 +433,7 @@ if ($request->isPost()) { $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. @@ -490,6 +490,6 @@ $smarty->assign('onload', 'onLoad="fillDropdowns()"'); $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'); diff --git a/week_view.php b/week_view.php index 99dc2eee..b273d278 100644 --- a/week_view.php +++ b/week_view.php @@ -52,17 +52,17 @@ $form = new Form('weekViewForm'); $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'); -- 2.20.1
'.htmlspecialchars($group_by_header).'".$i18n->getKey('label.duration').'".$i18n->getKey('label.cost').'".$i18n->get('label.duration').'".$i18n->get('label.cost').'
 
'.$i18n->getKey('label.total').''.$i18n->get('label.total').'".$totals['time'].'"; @@ -148,20 +148,20 @@ if ($totals_only) { // Table header. $html .= '
'.$i18n->getKey('label.date').''.$i18n->getKey('label.user').''.$i18n->getKey('label.client').''.$i18n->getKey('label.project').''.$i18n->getKey('label.task').''.$i18n->get('label.date').''.$i18n->get('label.user').''.$i18n->get('label.client').''.$i18n->get('label.project').''.$i18n->get('label.task').''.htmlspecialchars($custom_fields->fields[0]['label']).'".$i18n->getKey('label.start').'".$i18n->getKey('label.finish').'".$i18n->getKey('label.duration').''.$i18n->getKey('label.note').'".$i18n->getKey('label.cost').'".$i18n->getKey('label.paid').'".$i18n->getKey('label.ip').''.$i18n->getKey('label.invoice').'".$i18n->get('label.start').'".$i18n->get('label.finish').'".$i18n->get('label.duration').''.$i18n->get('label.note').'".$i18n->get('label.cost').'".$i18n->get('label.paid').'".$i18n->get('label.ip').''.$i18n->get('label.invoice').'
'.$i18n->getKey('label.subtotal').''.$i18n->get('label.subtotal').''; if ($group_by == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']); @@ -241,7 +241,7 @@ if ($totals_only) { } if ($bean->getAttribute('chpaid')) { $html .= ''; - $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 .= '
'.$i18n->getKey('label.subtotal').''.$i18n->get('label.subtotal').''; if ($group_by == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']); @@ -306,7 +306,7 @@ if ($totals_only) { // Print totals. $html .= '
 
'.$i18n->getKey('label.total').''.$i18n->get('label.total').'