From 5f64df1308fd641565631e6e38d282432f5e6250 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 23 Mar 2018 15:27:29 +0000 Subject: [PATCH] Refactoring. --- WEB-INF/lib/ttReportHelper.class.php | 92 +++++++++++++------------- WEB-INF/lib/ttRoleHelper.class.php | 40 +++++------ WEB-INF/lib/ttTeamHelper.class.php | 2 +- WEB-INF/lib/ttWeekViewHelper.class.php | 22 +++--- WEB-INF/templates/footer.tpl | 2 +- access_denied.php | 4 +- admin_options.php | 4 +- admin_team_add.php | 4 +- admin_team_delete.php | 8 +-- admin_team_edit.php | 6 +- admin_teams.php | 2 +- cf_custom_field_add.php | 12 ++-- 12 files changed, 99 insertions(+), 99 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 1f797ace..b894b037 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1188,7 +1188,7 @@ class ttReportHelper { $body .= ''; // Output title. - $body .= '

'.$i18n->getKey('form.mail.report_subject').': '.$totals['start_date'].' - '.$totals['end_date'].'

'; + $body .= '

'.$i18n->get('form.mail.report_subject').': '.$totals['start_date'].' - '.$totals['end_date'].'

'; // Output comment. if ($comment) $body .= '

'.htmlspecialchars($comment).'

'; @@ -1201,16 +1201,16 @@ class ttReportHelper { $group_by_header = htmlspecialchars($custom_fields->fields[0]['label']); else { $key = 'label.'.$group_by; - $group_by_header = $i18n->getKey($key); + $group_by_header = $i18n->get($key); } $body .= ''; $body .= ''; $body .= ''; if ($bean->getAttribute('chduration')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chcost')) - $body .= ''; + $body .= ''; $body .= ''; foreach($subtotals as $subtotal) { $body .= ''; @@ -1231,7 +1231,7 @@ class ttReportHelper { // Print totals. $body .= ''; $body .= ''; - $body .= ''; + $body .= ''; if ($bean->getAttribute('chduration')) { $body .= '
'.$group_by_header.''.$i18n->getKey('label.duration').''.$i18n->get('label.duration').''.$i18n->getKey('label.cost').''.$i18n->get('label.cost').'
 
'.$i18n->getKey('label.total').''.$i18n->get('label.total').''; if ($totals['time'] <> '0:00') $body .= $totals['time']; @@ -1251,33 +1251,33 @@ class ttReportHelper { // Print table header. $body .= ''; $body .= ''; - $body .= ''; + $body .= ''; if ($canViewReports || $isClient) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chclient')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chproject')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chtask')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chcf_1')) $body .= ''; if ($bean->getAttribute('chstart')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chfinish')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chduration')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chnote')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chcost')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chpaid')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chip')) - $body .= ''; + $body .= ''; if ($bean->getAttribute('chinvoice')) - $body .= ''; + $body .= ''; $body .= ''; // Initialize variables to print subtotals. @@ -1301,7 +1301,7 @@ class ttReportHelper { $cur_grouped_by = $record['grouped_by']; if ($cur_grouped_by != $prev_grouped_by && !$first_pass) { $body .= ''; - $body .= ''; + $body .= ''; $subtotal_name = htmlspecialchars($subtotals[$prev_grouped_by]['name']); if ($canViewReports || $isClient) $body .= ''; if ($bean->getAttribute('chclient')) $body .= ''; @@ -1353,7 +1353,7 @@ class ttReportHelper { $body .= ''; if ($bean->getAttribute('chpaid')) { $body .= ''; } if ($bean->getAttribute('chip')) { @@ -1374,7 +1374,7 @@ class ttReportHelper { // Print a terminating subtotal. if ($print_subtotals) { $body .= ''; - $body .= ''; + $body .= ''; $subtotal_name = htmlspecialchars($subtotals[$cur_grouped_by]['name']); if ($canViewReports || $isClient) $body .= ''; if ($bean->getAttribute('chclient')) $body .= ''; @@ -1399,7 +1399,7 @@ class ttReportHelper { // Print totals. $body .= ''; $body .= ''; - $body .= ''; + $body .= ''; if ($canViewReports || $isClient) $body .= ''; if ($bean->getAttribute('chclient')) $body .= ''; if ($bean->getAttribute('chproject')) $body .= ''; @@ -1424,7 +1424,7 @@ class ttReportHelper { // Output footer. if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) - $body .= '

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

'; + $body .= '

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

'; // Finish creating email body. $body .= ''; @@ -1484,7 +1484,7 @@ class ttReportHelper { $body .= ''; // Output title. - $body .= '

'.$i18n->getKey('form.mail.report_subject').': '.$totals['start_date'].' - '.$totals['end_date'].'

'; + $body .= '

'.$i18n->get('form.mail.report_subject').': '.$totals['start_date'].' - '.$totals['end_date'].'

'; // Output comment. // if ($comment) $body .= '

'.htmlspecialchars($comment).'

'; // No comment for fav. reports. @@ -1497,16 +1497,16 @@ class ttReportHelper { $group_by_header = htmlspecialchars($custom_fields->fields[0]['label']); else { $key = 'label.'.$group_by; - $group_by_header = $i18n->getKey($key); + $group_by_header = $i18n->get($key); } $body .= '
'.$i18n->getKey('label.date').''.$i18n->get('label.date').''.$i18n->getKey('label.user').''.$i18n->get('label.user').''.$i18n->getKey('label.client').''.$i18n->get('label.client').''.$i18n->getKey('label.project').''.$i18n->get('label.project').''.$i18n->getKey('label.task').''.$i18n->get('label.task').''.htmlspecialchars($custom_fields->fields[0]['label']).''.$i18n->getKey('label.start').''.$i18n->get('label.start').''.$i18n->getKey('label.finish').''.$i18n->get('label.finish').''.$i18n->getKey('label.duration').''.$i18n->get('label.duration').''.$i18n->getKey('label.note').''.$i18n->get('label.note').''.$i18n->getKey('label.cost').''.$i18n->get('label.cost').''.$i18n->getKey('label.paid').''.$i18n->get('label.paid').''.$i18n->getKey('label.ip').''.$i18n->get('label.ip').''.$i18n->getKey('label.invoice').''.$i18n->get('label.invoice').'
'.$i18n->getKey('label.subtotal').''.$i18n->get('label.subtotal').''.($group_by == 'user' ? $subtotal_name : '').''.($group_by == 'client' ? $subtotal_name : '').''.$record['cost'].''; - $body .= $record['paid'] == 1 ? $i18n->getKey('label.yes') : $i18n->getKey('label.no'); + $body .= $record['paid'] == 1 ? $i18n->get('label.yes') : $i18n->get('label.no'); $body .= '
'.$i18n->getKey('label.subtotal').''.$i18n->get('label.subtotal').''.($group_by == 'user' ? $subtotal_name : '').''.($group_by == 'client' ? $subtotal_name : '').'
 
'.$i18n->getKey('label.total').''.$i18n->get('label.total').'
'; $body .= ''; $body .= ''; if ($report['show_duration']) - $body .= ''; + $body .= ''; if ($report['show_cost']) - $body .= ''; + $body .= ''; $body .= ''; foreach($subtotals as $subtotal) { $body .= ''; @@ -1527,7 +1527,7 @@ class ttReportHelper { // Print totals. $body .= ''; $body .= ''; - $body .= ''; + $body .= ''; if ($report['show_duration']) { $body .= '
'.$group_by_header.''.$i18n->getKey('label.duration').''.$i18n->get('label.duration').''.$i18n->getKey('label.cost').''.$i18n->get('label.cost').'
 
'.$i18n->getKey('label.total').''.$i18n->get('label.total').''; if ($totals['time'] <> '0:00') $body .= $totals['time']; @@ -1547,33 +1547,33 @@ class ttReportHelper { // Print table header. $body .= ''; $body .= ''; - $body .= ''; + $body .= ''; if ($canViewReports || $isClient) - $body .= ''; + $body .= ''; if ($report['show_client']) - $body .= ''; + $body .= ''; if ($report['show_project']) - $body .= ''; + $body .= ''; if ($report['show_task']) - $body .= ''; + $body .= ''; if ($report['show_custom_field_1']) $body .= ''; if ($report['show_start']) - $body .= ''; + $body .= ''; if ($report['show_end']) - $body .= ''; + $body .= ''; if ($report['show_duration']) - $body .= ''; + $body .= ''; if ($report['show_note']) - $body .= ''; + $body .= ''; if ($report['show_cost']) - $body .= ''; + $body .= ''; if ($report['show_paid']) - $body .= ''; + $body .= ''; if ($report['show_ip']) - $body .= ''; + $body .= ''; if ($report['show_invoice']) - $body .= ''; + $body .= ''; $body .= ''; // Initialize variables to print subtotals. @@ -1597,7 +1597,7 @@ class ttReportHelper { $cur_grouped_by = $record['grouped_by']; if ($cur_grouped_by != $prev_grouped_by && !$first_pass) { $body .= ''; - $body .= ''; + $body .= ''; $subtotal_name = htmlspecialchars($subtotals[$prev_grouped_by]['name']); if ($canViewReports || $isClient) $body .= ''; if ($report['show_client']) $body .= ''; @@ -1649,7 +1649,7 @@ class ttReportHelper { $body .= ''; if ($report['show_paid']) { $body .= ''; } if ($report['show_ip']) { @@ -1670,7 +1670,7 @@ class ttReportHelper { // Print a terminating subtotal. if ($print_subtotals) { $body .= ''; - $body .= ''; + $body .= ''; $subtotal_name = htmlspecialchars($subtotals[$cur_grouped_by]['name']); if ($canViewReports || $isClient) $body .= ''; if ($report['show_client']) $body .= ''; @@ -1695,7 +1695,7 @@ class ttReportHelper { // Print totals. $body .= ''; $body .= ''; - $body .= ''; + $body .= ''; if ($canViewReports || $isClient) $body .= ''; if ($report['show_client']) $body .= ''; if ($report['show_project']) $body .= ''; @@ -1720,7 +1720,7 @@ class ttReportHelper { // Output footer. if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) - $body .= '

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

'; + $body .= '

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

'; // Finish creating email body. $body .= ''; diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index 18396704..7629df42 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -190,32 +190,32 @@ class ttRoleHelper { $rights_manager = $rights_comanager.',manage_features,manage_basic_settings,manage_advanced_settings,manage_roles,export_data,manage_subgroups'; // Active roles. - $name = $mdb2->quote($i18n->getKey('role.user.label')); - $description = $mdb2->quote($i18n->getKey('role.user.description')); + $name = $mdb2->quote($i18n->get('role.user.label')); + $description = $mdb2->quote($i18n->get('role.user.description')); $rights = $mdb2->quote($rights_user); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($team_id, $name, $description, 4, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; - $name = $mdb2->quote($i18n->getKey('role.client.label')); - $description = $mdb2->quote($i18n->getKey('role.client.description')); + $name = $mdb2->quote($i18n->get('role.client.label')); + $description = $mdb2->quote($i18n->get('role.client.description')); $rights = $mdb2->quote($rights_client); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($team_id, $name, $description, 16, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; - $name = $mdb2->quote($i18n->getKey('role.comanager.label')); - $description = $mdb2->quote($i18n->getKey('role.comanager.description')); + $name = $mdb2->quote($i18n->get('role.comanager.label')); + $description = $mdb2->quote($i18n->get('role.comanager.description')); $rights = $mdb2->quote($rights_comanager); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($team_id, $name, $description, 68, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; - $name = $mdb2->quote($i18n->getKey('role.manager.label')); - $description = $mdb2->quote($i18n->getKey('role.manager.description')); + $name = $mdb2->quote($i18n->get('role.manager.label')); + $description = $mdb2->quote($i18n->get('role.manager.description')); $rights = $mdb2->quote($rights_manager); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($team_id, $name, $description, 324, $rights, 1)"; $affected = $mdb2->exec($sql); @@ -223,8 +223,8 @@ class ttRoleHelper { return false; // Inactive roles. - $name = $mdb2->quote($i18n->getKey('role.supervisor.label')); - $description = $mdb2->quote($i18n->getKey('role.supervisor.description')); + $name = $mdb2->quote($i18n->get('role.supervisor.label')); + $description = $mdb2->quote($i18n->get('role.supervisor.description')); $rights = $mdb2->quote($rights_supervisor); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($team_id, $name, $description, 12, $rights, 0)"; $affected = $mdb2->exec($sql); @@ -248,32 +248,32 @@ class ttRoleHelper { $rights_manager = $rights_comanager.',manage_features,manage_basic_settings,manage_advanced_settings,manage_roles,export_data,manage_subgroups'; // Active roles. - $name = $mdb2->quote($i18n->getKey('role.user.label')); - $description = $mdb2->quote($i18n->getKey('role.user.description')); + $name = $mdb2->quote($i18n->get('role.user.label')); + $description = $mdb2->quote($i18n->get('role.user.description')); $rights = $mdb2->quote($rights_user); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($user->team_id, $name, $description, 4, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; - $name = $mdb2->quote($i18n->getKey('role.client.label')); - $description = $mdb2->quote($i18n->getKey('role.client.description')); + $name = $mdb2->quote($i18n->get('role.client.label')); + $description = $mdb2->quote($i18n->get('role.client.description')); $rights = $mdb2->quote($rights_client); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($user->team_id, $name, $description, 16, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; - $name = $mdb2->quote($i18n->getKey('role.comanager.label')); - $description = $mdb2->quote($i18n->getKey('role.comanager.description')); + $name = $mdb2->quote($i18n->get('role.comanager.label')); + $description = $mdb2->quote($i18n->get('role.comanager.description')); $rights = $mdb2->quote($rights_comanager); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($user->team_id, $name, $description, 68, $rights, 1)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; - $name = $mdb2->quote($i18n->getKey('role.manager.label')); - $description = $mdb2->quote($i18n->getKey('role.manager.description')); + $name = $mdb2->quote($i18n->get('role.manager.label')); + $description = $mdb2->quote($i18n->get('role.manager.description')); $rights = $mdb2->quote($rights_manager); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($user->team_id, $name, $description, 324, $rights, 1)"; $affected = $mdb2->exec($sql); @@ -281,8 +281,8 @@ class ttRoleHelper { return false; // Inactive roles. - $name = $mdb2->quote($i18n->getKey('role.supervisor.label')); - $description = $mdb2->quote($i18n->getKey('role.supervisor.description')); + $name = $mdb2->quote($i18n->get('role.supervisor.label')); + $description = $mdb2->quote($i18n->get('role.supervisor.description')); $rights = $mdb2->quote($rights_supervisor); $sql = "insert into tt_roles (team_id, name, description, rank, rights, status) values($user->team_id, $name, $description, 12, $rights, 0)"; $affected = $mdb2->exec($sql); diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 9f3e0a90..0d10a84f 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -85,7 +85,7 @@ class ttTeamHelper { while ($val = $res->fetchRow()) { // Localize top manager role name, as it is not localized in db. if ($val['rank'] == 512) - $val['role_name'] = $i18n->getKey('role.top_manager.label'); + $val['role_name'] = $i18n->get('role.top_manager.label'); $user_list[] = $val; } diff --git a/WEB-INF/lib/ttWeekViewHelper.class.php b/WEB-INF/lib/ttWeekViewHelper.class.php index af0960ae..f4ee719f 100644 --- a/WEB-INF/lib/ttWeekViewHelper.class.php +++ b/WEB-INF/lib/ttWeekViewHelper.class.php @@ -156,7 +156,7 @@ class ttWeekViewHelper { $dataArray = array(); // Construct the first row for a brand new entry. - $dataArray[] = array('row_id' => null,'label' => $i18n->getKey('form.week.new_entry').':'); // Insert row. + $dataArray[] = array('row_id' => null,'label' => $i18n->get('form.week.new_entry').':'); // Insert row. // Insert empty cells with proper control ids. for ($i = 0; $i < 7; $i++) { $control_id = '0_'. $dayHeaders[$i]; @@ -164,7 +164,7 @@ class ttWeekViewHelper { } if ($user->isPluginEnabled('wvns')) { // Construct the second row for daily comments for a brand new entry. - $dataArray[] = array('row_id' => null,'label' => $i18n->getKey('label.notes').':'); // Insert row. + $dataArray[] = array('row_id' => null,'label' => $i18n->get('label.notes').':'); // Insert row. // Insert empty cells with proper control ids. for ($i = 0; $i < 7; $i++) { $control_id = '1_'. $dayHeaders[$i]; @@ -197,7 +197,7 @@ class ttWeekViewHelper { } // Insert row for comments. if ($user->isPluginEnabled('wvns')) { - $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->getKey('label.notes').':'); + $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->get('label.notes').':'); $pos++; // Insert empty cells with proper control ids. for ($i = 0; $i < 7; $i++) { @@ -254,14 +254,14 @@ class ttWeekViewHelper { } // Construct the first row for a brand new entry. - $dataArray[] = array('row_id' => null,'label' => $i18n->getKey('form.week.new_entry').':'); // Insert row. + $dataArray[] = array('row_id' => null,'label' => $i18n->get('form.week.new_entry').':'); // Insert row. // Insert empty cells with proper control ids. for ($i = 0; $i < 7; $i++) { $control_id = '0_'. $dayHeaders[$i]; $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); } // Construct the second row for daily comments for a brand new entry. - $dataArray[] = array('row_id' => null,'label' => $i18n->getKey('label.notes').':'); // Insert row. + $dataArray[] = array('row_id' => null,'label' => $i18n->get('label.notes').':'); // Insert row. // Insert empty cells with proper control ids. for ($i = 0; $i < 7; $i++) { $control_id = '1_'. $dayHeaders[$i]; @@ -284,7 +284,7 @@ class ttWeekViewHelper { $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); } // Insert row for comments. - $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->getKey('label.notes').':'); + $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->get('label.notes').':'); $pos++; // Insert empty cells with proper control ids. for ($i = 0; $i < 7; $i++) { @@ -325,7 +325,7 @@ class ttWeekViewHelper { // Insert label. global $i18n; - $dayTotals['label'] = $i18n->getKey('label.day_total').':'; + $dayTotals['label'] = $i18n->get('label.day_total').':'; foreach ($dataArray as $row) { foreach($dayHeaders as $dayHeader) { @@ -485,7 +485,7 @@ class ttWeekViewHelper { if (!$user->future_entries && $fields['browser_today']) { $objBrowserToday = new DateAndTime(DB_DATEFORMAT, $fields['browser_today']); if ($objEntryDate->after($objBrowserToday)) { - $err->add($i18n->getKey('error.future_date')); + $err->add($i18n->get('error.future_date')); return false; } } @@ -550,7 +550,7 @@ class ttWeekViewHelper { $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { if (!$res->numRows()) { - $err->add($i18n->getKey('error.db')); // This is not expected. + $err->add($i18n->get('error.db')); // This is not expected. return false; } $val = $res->fetchRow(); @@ -571,7 +571,7 @@ class ttWeekViewHelper { $newEndMinutes = $startMinutes + $newMinutes; if ($newEndMinutes > 1440) { // Invalid duration, as new duration puts the record beyond current day. - $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration')); + $err->add($i18n->get('error.field'), $i18n->get('label.duration')); return false; } @@ -582,7 +582,7 @@ class ttWeekViewHelper { $start = ttTimeHelper::toAbsDuration($startMinutes); $finish = ttTimeHelper::toAbsDuration($newEndMinutes); if (ttTimeHelper::overlaps($user_id, $date, $start, $finish, $tt_log_id)) { - $err->add($i18n->getKey('error.overlap')); + $err->add($i18n->get('error.overlap')); return false; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index d92f371a..74eb876f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
'.$i18n->getKey('label.date').''.$i18n->get('label.date').''.$i18n->getKey('label.user').''.$i18n->get('label.user').''.$i18n->getKey('label.client').''.$i18n->get('label.client').''.$i18n->getKey('label.project').''.$i18n->get('label.project').''.$i18n->getKey('label.task').''.$i18n->get('label.task').''.htmlspecialchars($custom_fields->fields[0]['label']).''.$i18n->getKey('label.start').''.$i18n->get('label.start').''.$i18n->getKey('label.finish').''.$i18n->get('label.finish').''.$i18n->getKey('label.duration').''.$i18n->get('label.duration').''.$i18n->getKey('label.note').''.$i18n->get('label.note').''.$i18n->getKey('label.cost').''.$i18n->get('label.cost').''.$i18n->getKey('label.paid').''.$i18n->get('label.paid').''.$i18n->getKey('label.ip').''.$i18n->get('label.ip').''.$i18n->getKey('label.invoice').''.$i18n->get('label.invoice').'
'.$i18n->getKey('label.subtotal').''.$i18n->get('label.subtotal').''.($group_by == 'user' ? $subtotal_name : '').''.($group_by == 'client' ? $subtotal_name : '').''.$record['cost'].''; - $body .= $record['paid'] == 1 ? $i18n->getKey('label.yes') : $i18n->getKey('label.no'); + $body .= $record['paid'] == 1 ? $i18n->get('label.yes') : $i18n->get('label.no'); $body .= '
'.$i18n->getKey('label.subtotal').''.$i18n->get('label.subtotal').''.($group_by == 'user' ? $subtotal_name : '').''.($group_by == 'client' ? $subtotal_name : '').'
 
'.$i18n->getKey('label.total').''.$i18n->get('label.total').'
-
 Anuko Time Tracker 1.17.67.4142 | Copyright © Anuko | +  Anuko Time Tracker 1.17.67.4143 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/access_denied.php b/access_denied.php index 65a5ed72..72a28d19 100644 --- a/access_denied.php +++ b/access_denied.php @@ -28,9 +28,9 @@ 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', 'access_denied.tpl'); $smarty->display('index.tpl'); diff --git a/admin_options.php b/admin_options.php index 14cb3f54..cc9fd65c 100644 --- a/admin_options.php +++ b/admin_options.php @@ -58,7 +58,7 @@ if (!$auth->isPasswordExternal()) { $form->addInput(array('type'=>'password','maxlength'=>'30','name'=>'password2','value'=>$cl_password2)); } $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','value'=>$cl_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 ttAdmin instance. @@ -80,6 +80,6 @@ if ($request->isPost()) { $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->getKey('title.options')); +$smarty->assign('title', $i18n->get('title.options')); $smarty->assign('content_page_name', 'admin_options.tpl'); $smarty->display('index.tpl'); diff --git a/admin_team_add.php b/admin_team_add.php index b270de17..6d5bc84f 100644 --- a/admin_team_add.php +++ b/admin_team_add.php @@ -78,7 +78,7 @@ if (!$auth->isPasswordExternal()) { $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()) { /* @@ -115,5 +115,5 @@ $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.teamForm.team.focus()"'); $smarty->assign('content_page_name', 'admin_team_add.tpl'); -$smarty->assign('title', $i18n->getKey('title.create_team')); +$smarty->assign('title', $i18n->get('title.create_team')); $smarty->display('index.tpl'); diff --git a/admin_team_delete.php b/admin_team_delete.php index b2b462ce..a9ce1ee1 100644 --- a/admin_team_delete.php +++ b/admin_team_delete.php @@ -42,8 +42,8 @@ $team_name = $team_details['team_name']; $form = new Form('teamForm'); $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$team_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')) { @@ -54,7 +54,7 @@ if ($request->isPost()) { header('Location: admin_teams.php'); exit(); } else - $err->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } if ($request->getParameter('btn_cancel')) { @@ -65,6 +65,6 @@ if ($request->isPost()) { $smarty->assign('team_to_delete', $team_name); $smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->getKey('title.delete_team')); +$smarty->assign('title', $i18n->get('title.delete_team')); $smarty->assign('content_page_name', 'admin_team_delete.tpl'); $smarty->display('index.tpl'); diff --git a/admin_team_edit.php b/admin_team_edit.php index 63f8fe7a..a737050a 100644 --- a/admin_team_edit.php +++ b/admin_team_edit.php @@ -69,8 +69,8 @@ if (!$auth->isPasswordExternal()) { } $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email)); $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$team_id)); -$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save'))); -$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel'))); +$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); +$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); if ($request->isPost()) { if ($request->getParameter('btn_save')) { @@ -104,6 +104,6 @@ if ($request->isPost()) { $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.teamForm.manager_name.focus()"'); -$smarty->assign('title', $i18n->getKey('title.edit_team')); +$smarty->assign('title', $i18n->get('title.edit_team')); $smarty->assign('content_page_name', 'admin_team_edit.tpl'); $smarty->display('index.tpl'); diff --git a/admin_teams.php b/admin_teams.php index 55df54fc..7d2b3dfa 100644 --- a/admin_teams.php +++ b/admin_teams.php @@ -36,6 +36,6 @@ if (!ttAccessAllowed('administer_site')) { } $smarty->assign('teams', ttGroupHelper::getTopGroups()); -$smarty->assign('title', $i18n->getKey('title.teams')); +$smarty->assign('title', $i18n->get('title.teams')); $smarty->assign('content_page_name', 'admin_teams.tpl'); $smarty->display('index.tpl'); diff --git a/cf_custom_field_add.php b/cf_custom_field_add.php index f8ea01e0..30c82a5a 100644 --- a/cf_custom_field_add.php +++ b/cf_custom_field_add.php @@ -47,15 +47,15 @@ if ($request->isPost()) { $form = new Form('fieldForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>'')); $form->addInput(array('type'=>'combobox','name'=>'type', - 'data'=>array(CustomFields::TYPE_TEXT=>$i18n->getKey('label.type_text'), - CustomFields::TYPE_DROPDOWN=>$i18n->getKey('label.type_dropdown')) + 'data'=>array(CustomFields::TYPE_TEXT=>$i18n->get('label.type_text'), + CustomFields::TYPE_DROPDOWN=>$i18n->get('label.type_dropdown')) )); $form->addInput(array('type'=>'checkbox','name'=>'required')); -$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_field_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name')); + if (!ttValidString($cl_field_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if ($err->no()) { $res = CustomFields::insertField($cl_field_name, $cl_field_type, $cl_required); @@ -63,12 +63,12 @@ if ($request->isPost()) { header('Location: cf_custom_fields.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.fieldForm.name.focus()"'); -$smarty->assign('title', $i18n->getKey('title.cf_add_custom_field')); +$smarty->assign('title', $i18n->get('title.cf_add_custom_field')); $smarty->assign('content_page_name', 'cf_custom_field_add.tpl'); $smarty->display('index.tpl'); -- 2.20.1