$smarty->assign('active_clients', ttTeamHelper::getActiveClients($user->team_id, true));
$smarty->assign('inactive_clients', ttTeamHelper::getInactiveClients($user->team_id, true));
-$smarty->assign('title', $i18n->getKey('title.clients'));
+$smarty->assign('title', $i18n->get('title.clients'));
$smarty->assign('content_page_name', 'clients.tpl');
$smarty->display('index.tpl');
$expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser());
// Prohibit deleting invoiced records.
-if ($expense_item['invoice_id']) die($i18n->getKey('error.sys'));
+if ($expense_item['invoice_id']) die($i18n->get('error.sys'));
if ($request->isPost()) {
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it is okay to delete the record.
$item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']);
if ($user->isDateLocked($item_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
if ($err->no()) {
// Mark the record as deleted.
header('Location: expenses.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
if ($request->getParameter('cancel_button')) { // Cancel button pressed.
$form = new Form('expenseItemForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
-$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->getKey('label.delete')));
-$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->getKey('button.cancel')));
+$form->addInput(array('type'=>'submit','name'=>'delete_button','value'=>$i18n->get('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'cancel_button','value'=>$i18n->get('button.cancel')));
$smarty->assign('expense_item', $expense_item);
$smarty->assign('forms', array($form->getName() => $form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.delete_expense'));
+$smarty->assign('title', $i18n->get('title.delete_expense'));
$smarty->assign('content_page_name', 'expense_delete.tpl');
$smarty->display('index.tpl');
$expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser());
// Prohibit editing invoiced items.
-if ($expense_item['invoice_id']) die($i18n->getKey('error.sys'));
+if ($expense_item['invoice_id']) die($i18n->get('error.sys'));
$item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']);
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
// If predefined expenses are configured, add controls to select an expense and quantity.
'value'=>$cl_predefined_expense,
'data'=>$predefined_expenses,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'text','onchange'=>'recalculateCost();','maxlength'=>'40','name'=>'quantity','style'=>'width: 100px;','value'=>$cl_quantity));
}
$form->addInput(array('type'=>'textarea','maxlength'=>'800','name'=>'item_name','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_item_name));
// Hidden control for record id.
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save or btn_copy click.
-$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save')));
-$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.copy')));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
+$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.save')));
+$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.copy')));
+$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete')));
if ($request->isPost()) {
// Validate user input.
if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
- $err->add($i18n->getKey('error.client'));
+ $err->add($i18n->get('error.client'));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- if (!$cl_project) $err->add($i18n->getKey('error.project'));
+ if (!$cl_project) $err->add($i18n->get('error.project'));
}
- if (!ttValidString($cl_item_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.item'));
- if (!ttValidFloat($cl_cost)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cost'));
- if (!ttValidDate($cl_date)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.date'));
+ if (!ttValidString($cl_item_name)) $err->add($i18n->get('error.field'), $i18n->get('label.item'));
+ if (!ttValidFloat($cl_cost)) $err->add($i18n->get('error.field'), $i18n->get('label.cost'));
+ if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
// This is a new date for the expense item.
$new_date = new DateAndTime($user->date_format, $cl_date);
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($new_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Save record.
// Now, step by step.
// 1) Prohibit saving locked entries in any form.
if ($user->isDateLocked($item_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// 2) Prohibit saving unlocked entries into locked range.
if ($err->no() && $user->isDateLocked($new_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Now, an update.
if ($err->no()) {
if ($request->getParameter('btn_copy')) {
// We need to prohibit saving into locked interval.
if ($user->isDateLocked($new_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Now, a new insert.
if ($err->no()) {
header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT));
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
}
$smarty->assign('project_list', $project_list);
$smarty->assign('task_list', $task_list);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_expense'));
+$smarty->assign('title', $i18n->get('title.edit_expense'));
$smarty->assign('content_page_name', 'expense_edit.tpl');
$smarty->display('index.tpl');
'value'=>$cl_client,
'data'=>$active_clients,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Note: in other modes the client list is filtered to relevant clients only. See below.
}
'value'=>$cl_project,
'data'=>$project_list,
'datakeys'=>array('id','name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
'value'=>$cl_client,
'data'=>$client_list,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
}
// If predefined expenses are configured, add controls to select an expense and quantity.
'value'=>$cl_predefined_expense,
'data'=>$predefined_expenses,
'datakeys'=>array('id', 'name'),
- 'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ 'empty'=>array(''=>$i18n->get('dropdown.select'))));
$form->addInput(array('type'=>'text','onchange'=>'recalculateCost();','maxlength'=>'40','name'=>'quantity','style'=>'width: 100px;','value'=>$cl_quantity));
}
$form->addInput(array('type'=>'textarea','maxlength'=>'800','name'=>'item_name','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','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.comment'));
- 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.comment'));
+ if (!ttValidFloat($cl_cost)) $err->add($i18n->get('error.field'), $i18n->get('label.cost'));
// Prohibit creating entries in future.
if (!$user->future_entries) {
$browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
if ($selected_date->after($browser_today))
- $err->add($i18n->getKey('error.future_date'));
+ $err->add($i18n->get('error.future_date'));
}
// Finished validating input data.
// Prohibit creating entries in locked range.
if ($user->isDateLocked($selected_date))
- $err->add($i18n->getKey('error.range_locked'));
+ $err->add($i18n->get('error.range_locked'));
// Insert record.
if ($err->no()) {
header('Location: expenses.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
}
} elseif ($request->getParameter('onBehalfUser')) {
if($user->canManageTeam()) {
$smarty->assign('project_list', $project_list);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('timestring', $selected_date->toString($user->date_format));
-$smarty->assign('title', $i18n->getKey('title.expenses'));
+$smarty->assign('title', $i18n->get('title.expenses'));
$smarty->assign('content_page_name', 'expenses.tpl');
$smarty->display('index.tpl');
}
$cl_compression = $request->getParameter('compression');
-$compressors = array('' => $i18n->getKey('form.export.compression_none'));
+$compressors = array('' => $i18n->get('form.export.compression_none'));
if (function_exists('bzcompress'))
- $compressors['bzip'] = $i18n->getKey('form.export.compression_bzip');
+ $compressors['bzip'] = $i18n->get('form.export.compression_bzip');
$form = new Form('exportForm');
$form->addInput(array('type'=>'combobox','name'=>'compression','value'=>$cl_compression,'data'=>$compressors));
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.export')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.export')));
if ($request->isPost()) {
}
exit;
} else
- $err->add($i18n->getKey('error.sys'));
+ $err->add($i18n->get('error.sys'));
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.export'));
+$smarty->assign('title', $i18n->get('title.export'));
$smarty->assign('content_page_name', 'export.tpl');
$smarty->display('index.tpl');
$form = new Form('importForm');
$form->addInput(array('type'=>'upload','name'=>'xmlfile','value'=>'browse','maxsize'=>67108864)); // 64 MB file upload limit.
// Note: for the above limit to work make sure to set upload_max_filesize and post_max_size in php.ini to at least 64M.
-$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.import')));
+$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.import')));
if ($request->isPost()) {
$import = new ttImportHelper($err);
$import->importXml();
- if ($err->no()) $msg->add($i18n->getKey('form.import.success'));
+ if ($err->no()) $msg->add($i18n->get('form.import.success'));
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()) );
-$smarty->assign('title', $i18n->getKey('title.import'));
+$smarty->assign('title', $i18n->get('title.import'));
$smarty->assign('content_page_name', 'import.tpl');
$smarty->display('index.tpl');
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
$clients = ttTeamHelper::getActiveClients($user->team_id);
- $form->addInput(array('type'=>'combobox','name'=>'client','style'=>'width: 250px;','data'=>$clients,'datakeys'=>array('id','name'),'value'=>$cl_client,'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
+ $form->addInput(array('type'=>'combobox','name'=>'client','style'=>'width: 250px;','data'=>$clients,'datakeys'=>array('id','name'),'value'=>$cl_client,'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
// Dropdown for projects.
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
$projects = ttTeamHelper::getActiveProjects($user->team_id);
- $form->addInput(array('type'=>'combobox','name'=>'project','style'=>'width: 250px;','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_project,'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
+ $form->addInput(array('type'=>'combobox','name'=>'project','style'=>'width: 250px;','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_project,'empty'=>array(''=>$i18n->get('dropdown.all'))));
}
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'number','style'=>'width: 250px;','value'=>$cl_number));
$form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'start','value'=>$cl_start));
$form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'finish','value'=>$cl_finish));
-$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_number)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.invoice.number'));
- if (!ttValidDate($cl_date)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.date'));
- if (!$cl_client) $err->add($i18n->getKey('error.client'));
- if (!ttValidDate($cl_start)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start_date'));
- if (!ttValidDate($cl_finish)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.end_date'));
+ if (!ttValidString($cl_number)) $err->add($i18n->get('error.field'), $i18n->get('form.invoice.number'));
+ if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
+ if (!$cl_client) $err->add($i18n->get('error.client'));
+ if (!ttValidDate($cl_start)) $err->add($i18n->get('error.field'), $i18n->get('label.start_date'));
+ if (!ttValidDate($cl_finish)) $err->add($i18n->get('error.field'), $i18n->get('label.end_date'));
$fields = array('date'=>$cl_date,'name'=>$cl_number,'client_id'=>$cl_client,'project_id'=>$cl_project,'start_date'=>$cl_start,'end_date'=>$cl_finish);
if ($err->no()) {
if (ttInvoiceHelper::getInvoiceByName($cl_number))
- $err->add($i18n->getKey('error.invoice_exists'));
+ $err->add($i18n->get('error.invoice_exists'));
if (!ttInvoiceHelper::invoiceableItemsExist($fields))
- $err->add($i18n->getKey('error.no_invoiceable_items'));
+ $err->add($i18n->get('error.no_invoiceable_items'));
}
if ($err->no()) {
header('Location: invoices.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('onload', 'onLoad="document.invoiceForm.number.focus()"');
-$smarty->assign('title', $i18n->getKey('title.add_invoice'));
+$smarty->assign('title', $i18n->get('title.add_invoice'));
$smarty->assign('content_page_name', 'invoice_add.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_invoice_id));
$form->addInput(array('type'=>'combobox',
'name'=>'delete_invoice_entries',
- 'data'=>array('0'=>$i18n->getKey('dropdown.do_not_delete'),'1'=>$i18n->getKey('dropdown.delete')),
+ 'data'=>array('0'=>$i18n->get('dropdown.do_not_delete'),'1'=>$i18n->get('dropdown.delete')),
));
-$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete'),'onclick'=>'return confirm_deleting_entries();'));
-$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'),'onclick'=>'return confirm_deleting_entries();'));
+$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
header('Location: invoices.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: invoices.php');
exit();
$smarty->assign('invoice_to_delete', $invoice_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.invoiceDeleteForm.btn_cancel.focus()"');
-$smarty->assign('title', $i18n->getKey('title.delete_invoice'));
+$smarty->assign('title', $i18n->get('title.delete_invoice'));
$smarty->assign('content_page_name', 'invoice_delete.tpl');
$smarty->display('index.tpl');
// Security check.
if (!$cl_invoice_id || !$invoice)
- die ($i18n->getKey('error.sys'));
+ die ($i18n->get('error.sys'));
if ($request->isPost()) {
$cl_receiver = trim($request->getParameter('receiver'));
} else {
$cl_receiver = $sc->getValue(SYSC_LAST_INVOICE_EMAIL);
$cl_cc = $sc->getValue(SYSC_LAST_INVOICE_CC);
- $cl_subject = $i18n->getKey('title.invoice').' '.$invoice['name'].', '.$user->team;
+ $cl_subject = $i18n->get('title.invoice').' '.$invoice['name'].', '.$user->team;
}
$form = new Form('mailForm');
$form->addInput(array('type'=>'text','name'=>'cc','style'=>'width: 300px;','value'=>$cl_cc));
$form->addInput(array('type'=>'text','name'=>'subject','style'=>'width: 300px;','value'=>$cl_subject));
$form->addInput(array('type'=>'textarea','name'=>'comment','maxlength'=>'250','style'=>'width: 300px; height: 60px;'));
-$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->getKey('button.send')));
+$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->get('button.send')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidEmailList($cl_receiver)) $err->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.to'));
- if (!ttValidEmailList($cl_cc, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cc'));
- if (!ttValidString($cl_subject)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.subject'));
- if (!ttValidString($cl_comment, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.comment'));
+ if (!ttValidEmailList($cl_receiver)) $err->add($i18n->get('error.field'), $i18n->get('form.mail.to'));
+ if (!ttValidEmailList($cl_cc, true)) $err->add($i18n->get('error.field'), $i18n->get('label.cc'));
+ if (!ttValidString($cl_subject)) $err->add($i18n->get('error.field'), $i18n->get('label.subject'));
+ if (!ttValidString($cl_comment, true)) $err->add($i18n->get('error.field'), $i18n->get('label.comment'));
if ($err->no()) {
// Save last invoice emails for future use.
$mailer->setReceiverBCC($user->bcc_email);
$mailer->setMailMode(MAIL_MODE);
if ($mailer->send($cl_subject, $body))
- $msg->add($i18n->getKey('form.mail.invoice_sent'));
+ $msg->add($i18n->get('form.mail.invoice_sent'));
else
- $err->add($i18n->getKey('error.mail_send'));
+ $err->add($i18n->get('error.mail_send'));
}
} // isPost
}
}
-$smarty->assign('title', $i18n->getKey('title.send_invoice'));
+$smarty->assign('title', $i18n->get('title.send_invoice'));
$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');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
// invoiceForm only contains controls for "Mark paid" block below invoice table.
if ($user->isPluginEnabled('ps')) {
- $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')));
}
if ($request->isPost()) {
$smarty->assign('client_address', $client['address']);
$smarty->assign('invoice_items', $invoice_items);
$smarty->assign('colspan', $colspan);
-$smarty->assign('title', $i18n->getKey('title.view_invoice'));
+$smarty->assign('title', $i18n->get('title.view_invoice'));
$smarty->assign('content_page_name', 'invoice_view.tpl');
$smarty->display('index.tpl');
$invoices = ttTeamHelper::getActiveInvoices();
$smarty->assign('invoices', $invoices);
-$smarty->assign('title', $i18n->getKey('title.invoices'));
+$smarty->assign('title', $i18n->get('title.invoices'));
$smarty->assign('content_page_name', 'invoices.tpl');
$smarty->display('index.tpl');
$form = new Form('lockingForm');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'lock_spec','style'=>'width: 250px;','value'=>$cl_lock_spec));
-$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 (!ttValidCronSpec($cl_lock_spec)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.schedule'));
+ if (!ttValidCronSpec($cl_lock_spec)) $err->add($i18n->get('error.field'), $i18n->get('label.schedule'));
if ($err->no()) {
if (ttTeamHelper::update($user->team_id, array(
header('Location: profile_edit.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.locking'));
+$smarty->assign('title', $i18n->get('title.locking'));
$smarty->assign('content_page_name', 'locking.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'text','size'=>'25','maxlength'=>'100','name'=>'login','style'=>'width: 220px;','value'=>$cl_login));
$form->addInput(array('type'=>'password','size'=>'25','maxlength'=>'50','name'=>'password','style'=>'width: 220px;','value'=>$cl_password));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_login click.
-$form->addInput(array('type'=>'submit','name'=>'btn_login','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.login')));
+$form->addInput(array('type'=>'submit','name'=>'btn_login','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.login')));
if ($request->isPost()) {
// Validate user input.
- if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
- if (!ttValidString($cl_password)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
+ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login'));
+ if (!ttValidString($cl_password)) $err->add($i18n->get('error.field'), $i18n->get('label.password'));
if ($err->no()) {
// Use the "limit" plugin if we have one. Ignore include errors.
}
exit();
} else
- $err->add($i18n->getKey('error.auth'));
+ $err->add($i18n->get('error.auth'));
}
} // isPost
if(!isTrue(MULTITEAM_MODE) && !ttGroupHelper::getTopGroups())
- $err->add($i18n->getKey('error.no_teams'));
+ $err->add($i18n->get('error.no_teams'));
// Determine whether to show login hint. It is currently used only for Windows LDAP authentication.
$show_hint = ('ad' == $GLOBALS['AUTH_MODULE_PARAMS']['type']);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('show_hint', $show_hint);
$smarty->assign('onload', 'onLoad="document.loginForm.'.(!$cl_login?'login':'password').'.focus()"');
-$smarty->assign('title', $i18n->getKey('title.login'));
+$smarty->assign('title', $i18n->get('title.login'));
$smarty->assign('content_page_name', 'login.tpl');
-$smarty->assign('about_text', $i18n->getKey('form.login.about'));
+$smarty->assign('about_text', $i18n->get('form.login.about'));
$smarty->display('index.tpl');
require_once('../initialize.php');
-$err->add($i18n->getKey('error.access_denied'));
+$err->add($i18n->get('error.access_denied'));
if ($auth->isAuthenticated()) $smarty->assign('authenticated', true); // Used in header.tpl for menu display.
-$smarty->assign('title', $i18n->getKey('label.error'));
+$smarty->assign('title', $i18n->get('label.error'));
$smarty->assign('content_page_name', 'mobile/access_denied.tpl');
$smarty->display('mobile/index.tpl');
$form->addInput(array('type'=>'floatfield','name'=>'tax','size'=>'10','format'=>'.2','value'=>$cl_tax));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','data'=>$projects,'layout'=>'H','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.client_name'));
- if (!ttValidString($cl_address, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.client_address'));
- if (!ttValidFloat($cl_tax, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.tax'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.client_name'));
+ if (!ttValidString($cl_address, true)) $err->add($i18n->get('error.field'), $i18n->get('label.client_address'));
+ if (!ttValidFloat($cl_tax, true)) $err->add($i18n->get('error.field'), $i18n->get('label.tax'));
if ($err->no()) {
if (!ttClientHelper::getClientByName($cl_name)) {
header('Location: clients.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.client_exists'));
+ $err->add($i18n->get('error.client_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.clientForm.name.focus()"');
-$smarty->assign('title', $i18n->getKey('title.add_client'));
+$smarty->assign('title', $i18n->get('title.add_client'));
$smarty->assign('content_page_name', 'mobile/client_add.tpl');
$smarty->display('mobile/index.tpl');
$form = new Form('clientDeleteForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$id));
$form->addInput(array('type'=>'combobox','name'=>'delete_client_entries',
- 'data'=>array('0'=>$i18n->getKey('dropdown.do_not_delete'),'1'=>$i18n->getKey('dropdown.delete'))));
-$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')));
+ 'data'=>array('0'=>$i18n->get('dropdown.do_not_delete'),'1'=>$i18n->get('dropdown.delete'))));
+$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(ttClientHelper::getClient($id)) {
header('Location: clients.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'));
if ($request->getParameter('btn_cancel')) {
header('Location: clients.php');
$smarty->assign('client_to_delete', $client_to_delete);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.delete_client'));
+$smarty->assign('title', $i18n->get('title.delete_client'));
$smarty->assign('content_page_name', 'mobile/client_delete.tpl');
$smarty->display('mobile/index.tpl');
$form->addInput(array('type'=>'textarea','name'=>'address','maxlength'=>'255','class'=>'mobile-textarea','value'=>$cl_address));
$form->addInput(array('type'=>'floatfield','name'=>'tax','size'=>'10','format'=>'.2','value'=>$cl_tax));
$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'))));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','data'=>$projects,'datakeys'=>array('id','name'),'layout'=>'H','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.client_name'));
- if (!ttValidString($cl_address, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.client_address'));
- if (!ttValidFloat($cl_tax, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.tax'));
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.client_name'));
+ if (!ttValidString($cl_address, true)) $err->add($i18n->get('error.field'), $i18n->get('label.client_address'));
+ if (!ttValidFloat($cl_tax, true)) $err->add($i18n->get('error.field'), $i18n->get('label.tax'));
if ($err->no()) {
if ($request->getParameter('btn_save')) {
header('Location: clients.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.client_exists'));
+ $err->add($i18n->get('error.client_exists'));
}
if ($request->getParameter('btn_copy')) {
header('Location: clients.php');
exit();
} else
- $err->add($i18n->getKey('error.db'));
+ $err->add($i18n->get('error.db'));
} else
- $err->add($i18n->getKey('error.client_exists'));
+ $err->add($i18n->get('error.client_exists'));
}
if ($request->getParameter('btn_delete')) {
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('title', $i18n->getKey('title.edit_client'));
+$smarty->assign('title', $i18n->get('title.edit_client'));
$smarty->assign('content_page_name', 'mobile/client_edit.tpl');
$smarty->display('mobile/index.tpl');
$smarty->assign('active_clients', ttTeamHelper::getActiveClients($user->team_id, true));
$smarty->assign('inactive_clients', ttTeamHelper::getInactiveClients($user->team_id, true));
-$smarty->assign('title', $i18n->getKey('title.clients'));
+$smarty->assign('title', $i18n->get('title.clients'));
$smarty->assign('content_page_name', 'mobile/clients.tpl');
$smarty->display('mobile/index.tpl');