From 95356f167c97ca1a70fc78d91a9dbc7b1d258b31 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 6 Apr 2018 17:02:03 +0000 Subject: [PATCH] More refactoring. --- WEB-INF/config.php.dist | 9 ++------- WEB-INF/lib/ttAdmin.class.php | 2 +- WEB-INF/lib/ttClientHelper.class.php | 4 ++-- WEB-INF/lib/ttExportHelper.class.php | 8 ++++---- WEB-INF/lib/ttTeamHelper.class.php | 2 +- WEB-INF/lib/ttUser.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/header.tpl | 2 +- group_edit.php | 2 +- invoice_send.php | 2 +- locking.php | 2 +- quotas.php | 2 +- 12 files changed, 18 insertions(+), 23 deletions(-) diff --git a/WEB-INF/config.php.dist b/WEB-INF/config.php.dist index 8e9cf20f..1218f7f6 100644 --- a/WEB-INF/config.php.dist +++ b/WEB-INF/config.php.dist @@ -42,11 +42,10 @@ define('DSN', 'mysqli://root:no@localhost/dbname?charset=utf8'); // and now you see some corrupted characters. See http://dev.mysql.com/doc/refman/5.0/en/charset-mysql.html -// MULTITEAM_MODE option defines whether users can create their own teams. +// MULTITEAM_MODE option defines whether users can create their own top groups (organizations). +// When false, a Time Tracker server is managed by admin, who creates top groups (one or many). // // Available values are true or false. -// If true users can create their own teams. -// If false only admin can create teams. // define('MULTITEAM_MODE', true); @@ -208,7 +207,3 @@ define('AUTH_MODULE', 'db'); // Height in pixels for the note input field in time.php. Defaults to 40. // define('NOTE_INPUT_HEIGHT', 100); - -// define('MANAGER_ONLY_TEAM_SETTINGS', true); // Note: temporary define, to be removed after introduction of role edits. - // Currently checked for "defined" only in profile_edit.tpl, meaning that false - // value here means the same thing. \ No newline at end of file diff --git a/WEB-INF/lib/ttAdmin.class.php b/WEB-INF/lib/ttAdmin.class.php index 50bffb6f..30c78f94 100644 --- a/WEB-INF/lib/ttAdmin.class.php +++ b/WEB-INF/lib/ttAdmin.class.php @@ -168,7 +168,7 @@ class ttAdmin { // If we mark all of them deleted here, we can't recover nicely // as we'll lose track of what was deleted by user. // - // 2) DB maintenance script (Clean up DB from inactive teams) should + // 2) DB maintenance script (Clean up DB from inactive groups) should // get rid of these items permanently eventually. // Mark group deleted. diff --git a/WEB-INF/lib/ttClientHelper.class.php b/WEB-INF/lib/ttClientHelper.class.php index f11edc90..afa7afbd 100644 --- a/WEB-INF/lib/ttClientHelper.class.php +++ b/WEB-INF/lib/ttClientHelper.class.php @@ -51,7 +51,7 @@ class ttClientHelper { return false; } - // getClients - returns an array of active and inactive clients in a team. + // getClients - returns an array of active and inactive clients in a group. static function getClients() { global $user; @@ -241,7 +241,7 @@ class ttClientHelper { return (!is_a($affected, 'PEAR_Error')); } - // The setMappedClient function is used during team import to change client_id value for tt_users to a mapped value. + // The setMappedClient function is used during group import to change client_id value for tt_users to a mapped value. static function setMappedClient($group_id, $imported_id, $mapped_id) { $mdb2 = getConnection(); diff --git a/WEB-INF/lib/ttExportHelper.class.php b/WEB-INF/lib/ttExportHelper.class.php index c26937eb..243ed3e1 100644 --- a/WEB-INF/lib/ttExportHelper.class.php +++ b/WEB-INF/lib/ttExportHelper.class.php @@ -29,7 +29,7 @@ import('ttTeamHelper'); import('ttTimeHelper'); -// ttExportHelper - this class is used to export team data to a file. +// ttExportHelper - this class is used to export group data to a file. class ttExportHelper { var $fileName = null; // Name of the file with data. @@ -45,7 +45,7 @@ class ttExportHelper { var $customFieldOptionMap = array(); // Custop field option ids. var $logMap = array(); // Time log ids. - // createDataFile creates a file with all data for a given team. + // createDataFile creates a file with all data for a given group. function createDataFile($compress = false) { global $user; @@ -61,7 +61,7 @@ class ttExportHelper { fwrite($file, "\n"); fwrite($file, "\n"); - // Write team info. + // Write group info. fwrite($file, "currency."\" decimal_mark=\"".$user->decimal_mark."\" lang=\"".$user->lang. "\" date_format=\"".$user->date_format."\" time_format=\"".$user->time_format."\" week_start=\"".$user->week_start. "\" tracking_mode=\"".$user->tracking_mode."\" project_required=\"".$user->project_required."\" task_required=\"".$user->task_required. @@ -69,7 +69,7 @@ class ttExportHelper { "\" plugins=\"".$user->plugins."\" lock_spec=\"".$user->lock_spec."\" workday_minutes=\"".$user->workday_minutes. "\" config=\"".$user->config. "\">\n"); - fwrite($file, " team."]]>\n"); + fwrite($file, " group."]]>\n"); fwrite($file, "\n"); // Prepare role map. diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 5091c1f9..6920ab35 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -1100,7 +1100,7 @@ class ttTeamHelper { $plugins = implode(',', $plugin_array); if ($plugins != $user->plugins) { - if (!ttTeamHelper::update($user->group_id, array('name' => $user->team,'plugins' => $plugins))) + if (!ttTeamHelper::update($user->group_id, array('name' => $user->group,'plugins' => $plugins))) return false; $user->plugins = $plugins; } diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index e3de5b4c..dfcd1a6b 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -57,7 +57,7 @@ class ttUser { var $currency = null; // Currency. var $plugins = null; // Comma-separated list of enabled plugins. var $config = null; // Comma-separated list of miscellaneous config options. - var $team = null; // Team name. + var $group = null; // Group name. var $custom_logo = 0; // Whether to use a custom logo for team. var $lock_spec = null; // Cron specification for record locking. var $workday_minutes = 480; // Number of work minutes in a regular day. @@ -113,7 +113,7 @@ class ttUser { $this->record_type = $val['record_type']; $this->bcc_email = $val['bcc_email']; $this->allow_ip = $val['allow_ip']; - $this->team = $val['group_name']; + $this->group = $val['group_name']; $this->currency = $val['currency']; $this->plugins = $val['plugins']; $this->lock_spec = $val['lock_spec']; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 36349199..0487798e 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.87.4236 | Copyright © Anuko | +  Anuko Time Tracker 1.17.87.4237 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index 2752dc42..aa59d3ff 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -158,7 +158,7 @@ {if $user->name} - + {else} {/if} diff --git a/group_edit.php b/group_edit.php index 6ec572e9..b5deee87 100644 --- a/group_edit.php +++ b/group_edit.php @@ -76,7 +76,7 @@ if ($request->isPost()) { $cl_quotas = $request->getParameter('quotas'); $cl_week_view = $request->getParameter('week_view'); } else { - $cl_team = $user->team; + $cl_team = $user->group; $cl_currency = ($user->currency == ''? CURRENCY_DEFAULT : $user->currency); $cl_lang = $user->lang; $cl_decimal_mark = $user->decimal_mark; diff --git a/invoice_send.php b/invoice_send.php index 20c3c187..ca76f34b 100644 --- a/invoice_send.php +++ b/invoice_send.php @@ -58,7 +58,7 @@ if ($request->isPost()) { } else { $cl_receiver = $sc->getValue(SYSC_LAST_INVOICE_EMAIL); $cl_cc = $sc->getValue(SYSC_LAST_INVOICE_CC); - $cl_subject = $i18n->get('title.invoice').' '.$invoice['name'].', '.$user->team; + $cl_subject = $i18n->get('title.invoice').' '.$invoice['name'].', '.$user->group; } $form = new Form('mailForm'); diff --git a/locking.php b/locking.php index 99e79a21..2de307ee 100644 --- a/locking.php +++ b/locking.php @@ -52,7 +52,7 @@ if ($request->isPost()) { if ($err->no()) { if (ttTeamHelper::update($user->group_id, array( - 'name' => $user->team, + 'name' => $user->group, 'lock_spec' => $cl_lock_spec))) { header('Location: profile_edit.php'); exit(); diff --git a/quotas.php b/quotas.php index 8e6f59c4..a453099e 100644 --- a/quotas.php +++ b/quotas.php @@ -90,7 +90,7 @@ if ($request->isPost()){ // Handle workday hours. $workday_minutes = ttTimeHelper::postedDurationToMinutes($request->getParameter('workdayHours')); if ($workday_minutes != $user->workday_minutes) { - if (!ttTeamHelper::update($user->group_id, array('name'=>$user->team,'workday_minutes'=>$workday_minutes))) + if (!ttTeamHelper::update($user->group_id, array('name'=>$user->group,'workday_minutes'=>$workday_minutes))) $err->add($i18n->get('error.db')); } -- 2.20.1
{$title}{if $timestring}: {$timestring}{/if}
{$user->name|escape} - {$user->role_name|escape}{if $user->behalf_id > 0} {$i18n.label.on_behalf} {$user->behalf_name|escape}{/if}{if $user->team}, {$user->team|escape}{/if}
{$user->name|escape} - {$user->role_name|escape}{if $user->behalf_id > 0} {$i18n.label.on_behalf} {$user->behalf_name|escape}{/if}{if $user->group}, {$user->group|escape}{/if}