// | https://www.anuko.com/time_tracker/credits.htm
// +----------------------------------------------------------------------+
-import('ttTeamHelper');
-import('ttUserHelper');
-
// Class ttNotificationHelper is used to help with notification related tasks.
class ttNotificationHelper {
return $result;
}
- // getInactiveRoles - returns an array of inactive roles for team.
+ // getInactiveRoles - returns an array of inactive roles for a group.
static function getInactiveRoles($group_id)
{
$result = array();
return false;
}
- // The getInactiveTeams is a maintenance function that returns an array of inactive group ids (max 100).
- static function getInactiveTeams() {
- $inactive_teams = array();
+ // The getInactiveGroups is a maintenance function that returns an array of inactive group ids (max 100).
+ static function getInactiveGroups() {
+ $inactive_groups = array();
$mdb2 = getConnection();
- // Get all team ids for teams created or modified more than 8 months ago.
+ // Get all group ids for groups created or modified more than 8 months ago.
// $ts = date('Y-m-d', strtotime('-1 year'));
$ts = $mdb2->quote(date('Y-m-d', strtotime('-8 month')));
$sql = "select id from tt_groups where created < $ts and (modified is null or modified < $ts) order by id";
if (!is_a($res, 'PEAR_Error')) {
while ($val = $res->fetchRow()) {
$group_id = $val['id'];
- if (ttTeamHelper::isTeamActive($group_id) == false) {
+ if (ttTeamHelper::isGroupActive($group_id) == false) {
$count++;
- $inactive_teams[] = $group_id;
+ $inactive_groups[] = $group_id;
// Limit the array size for perfomance by allowing this operation on small chunks only.
if ($count >= 100) break;
}
}
- return $inactive_teams;
+ return $inactive_groups;
}
return false;
}
- // The isTeamActive determines if a team is using Time Tracker or abandoned it.
- static function isTeamActive($group_id) {
+ // The isGroupActive determines if a group is using Time Tracker or abandoned it.
+ static function isGroupActive($group_id) {
$users = array();
$mdb2 = getConnection();
}
$user_list = implode(',', $users); // This is a comma-separated list of user ids.
if (!$user_list)
- return false; // No users in team.
+ return false; // No users in group.
$count = 0;
$ts = date('Y-m-d', strtotime('-2 years'));
return false; // No time entries for the last 2 years.
if ($count <= 5) {
- // We will consider a team inactive if it has 5 or less time entries made more than 1 year ago.
+ // We will consider a group inactive if it has 5 or less time entries made more than 1 year ago.
$count_last_year = 0;
$ts = date('Y-m-d', strtotime('-1 year'));
$sql = "select count(*) as cnt from tt_log where user_id in ($user_list) and created > '$ts'";
return true;
}
- // The delete function permanently deletes all data for a team.
+ // The delete function permanently deletes all data for a group.
static function delete($group_id) {
$mdb2 = getConnection();
return true;
}
- // The markTasksDeleted deletes task binds and marks the tasks as deleted for a team.
+ // The markTasksDeleted deletes task binds and marks the tasks as deleted for a group.
static function markTasksDeleted($group_id) {
$mdb2 = getConnection();
$sql = "select id from tt_tasks where group_id = $group_id";
return true;
}
- // The deleteTasks deletes all tasks and task binds for an inactive team.
+ // The deleteTasks deletes all tasks and task binds for an inactive group.
static function deleteTasks($group_id) {
$mdb2 = getConnection();
$sql = "select id from tt_tasks where group_id = $group_id";
return true;
}
- // The deleteCustomFields cleans up tt_custom_field_log, tt_custom_field_options and tt_custom_fields tables for an inactive team.
+ // The deleteCustomFields cleans up tt_custom_field_log, tt_custom_field_options and tt_custom_fields tables for an inactive group.
static function deleteCustomFields($group_id) {
$mdb2 = getConnection();
$sql = "select id from tt_custom_fields where group_id = $group_id";
var $plugins = null; // Comma-separated list of enabled plugins.
var $config = null; // Comma-separated list of miscellaneous config options.
var $group = null; // Group name.
- var $custom_logo = 0; // Whether to use a custom logo for team.
+ var $custom_logo = 0; // Whether to use a custom logo for group.
var $lock_spec = null; // Cron specification for record locking.
var $workday_minutes = 480; // Number of work minutes in a regular day.
var $rights = array(); // An array of user rights such as 'track_own_time', etc.
return $this->can('administer_site');
}
- // isManager - determines whether current user is team manager.
+ // isManager - determines whether current user is group manager.
// This is a legacy function that we are getting rid of by replacing with rights check.
function isManager() {
return $this->can('export_data'); // By default this is assigned to managers but not co-managers.
// to this function and then remove it.
}
- // isCoManager - determines whether current user is team comanager.
+ // isCoManager - determines whether current user is group comanager.
// This is a legacy function that we are getting rid of by replacing with rights check.
function isCoManager() {
return ($this->can('manage_users') && !$this->can('export_data'));
// Tho logic is different depending on who is doing the operation.
// Co-manager and admin - mark user deleted.
- // Manager - mark user deleted. If manager is the only account in team, mark team items deleted.
+ // Manager - mark user deleted. If manager is the only account in group, mark group items deleted.
// admin part.
if ($user->isAdmin()) {
if (is_a($affected, 'PEAR_Error'))
return false;
- // Mark team deleted.
+ // Mark group deleted.
$sql = "update tt_groups set status = NULL where id = $user->group_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
'menu.logout' => 'Logout',
'menu.forum' => 'Forum',
'menu.help' => 'Aiuto',
-'menu.create_team' => 'Crea gruppo',
+'menu.create_group' => 'Crea gruppo',
'menu.profile' => 'Profilo',
'menu.group' => 'Gruppo',
'menu.time' => 'Tempo',
<td class="tableHeader">{$i18n.label.edit}</td>
<td class="tableHeader">{$i18n.label.delete}</td>
</tr>
-{if $teams}
- {foreach $teams as $team}
+{if $groups}
+ {foreach $groups as $group}
<tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
- <td>{$team.id}</td>
- <td>{$team.name|escape}</td>
- <td nowrap>{$team.date}</td>
- <td align="center">{$team.lang}</td>
- <td><a href="admin_group_edit.php?id={$team.id}">{$i18n.label.edit}</a></td>
- <td><a href="admin_group_delete.php?id={$team.id}">{$i18n.label.delete}</a></td>
+ <td>{$group.id}</td>
+ <td>{$group.name|escape}</td>
+ <td nowrap>{$group.date}</td>
+ <td align="center">{$group.lang}</td>
+ <td><a href="admin_group_edit.php?id={$group.id}">{$i18n.label.edit}</a></td>
+ <td><a href="admin_group_delete.php?id={$group.id}">{$i18n.label.delete}</a></td>
</tr>
{/foreach}
{/if}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.87.4243 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.87.4244 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
}
// End of access checks.
-$smarty->assign('teams', ttGroupHelper::getTopGroups());
+$smarty->assign('groups', ttGroupHelper::getTopGroups());
$smarty->assign('title', $i18n->get('title.groups'));
$smarty->assign('content_page_name', 'admin_groups.tpl');
$smarty->display('index.tpl');
if ($_POST["cleanup"]) {
$mdb2 = getConnection();
- $inactive_teams = ttTeamHelper::getInactiveTeams();
+ $inactive_teams = ttTeamHelper::getInactiveGroups();
$count = count($inactive_teams);
print "$count inactive teams found...<br>\n";
require_once('initialize.php');
import('form.Form');
-import('ttTeamHelper');
// Access checks.
if (!ttAccessAllowed('manage_advanced_settings')) {
$inactive_users = ttTeamHelper::getInactiveUsers($user->group_id, true);
}
-// Check if the team is set to show indicators for uncompleted time entries.
+// Check if the group is set to show indicators for uncompleted time entries.
if ($user->uncompleted_indicators) {
// Check each active user if they have an uncompleted time entry.
foreach ($active_users as $key => $user) {
#
-# Structure for table tt_groups. A team is a group of users for whom we are tracking work time.
+# Structure for table tt_groups. A group is a unit of users for whom we are tracking work time.
# This table stores settings common to all group members such as language, week start day, etc.
#
CREATE TABLE `tt_groups` (
`record_type` smallint(2) NOT NULL default 0, # time record type ("start and finish", "duration", or both)
`bcc_email` varchar(100) default NULL, # bcc email to copy all reports to
`allow_ip` varchar(255) default NULL, # specification from where users are allowed access
- `plugins` varchar(255) default NULL, # a list of enabled plugins for team
+ `plugins` varchar(255) default NULL, # a list of enabled plugins for group
`lock_spec` varchar(255) default NULL, # Cron specification for record locking,
# for example: "0 10 * * 1" for "weekly on Mon at 10:00".
`workday_minutes` smallint(4) default 480, # number of work minutes in a regular working day
#
-# Structure for table tt_roles. This table stores customized team roles.
+# Structure for table tt_roles. This table stores group roles.
#
CREATE TABLE `tt_roles` (
`id` int(11) NOT NULL auto_increment, # Role id. Identifies roles for all groups on the server.
`name` varchar(80) default NULL, # Role name - custom role name. In case we are editing a
# predefined role (USER, etc.), we can rename the role here.
`description` varchar(255) default NULL, # Role description.
- `rank` int(11) default 0, # Role rank, an integer value between 0-324. Predefined role ranks:
- # USER - 4, CLIENT - 16, COMANAGER - 68, MANAGER - 324.
+ `rank` int(11) default 0, # Role rank, an integer value between 0-512. Predefined role ranks:
+ # User - 4, Supervisor - 12, Client - 16,
+ # Co-manager - 68, Manager - 324, Top manager - 512.
# Rank is used to determine what "lesser roles" are in each group
- # for sutuations such as "manage_users".
- # It also identifies a role within a team (by its "rank").
- # Value of rank is to be used in role field in tt_users table,
- # just like standard roles now.
+ # for situations such as "manage_users".
`rights` text default NULL, # Comma-separated list of rights assigned to a role.
# NULL here for predefined roles (4, 16, 68, 324 - manager)
# means a hard-coded set of default access rights.
# Create an index that guarantees unique active and inactive logins.
create unique index login_idx on tt_users(login, status);
-# Create admin account with password 'secret'. Admin is a superuser, who can create teams.
+# Create admin account with password 'secret'. Admin is a superuser, who can create groupd.
DELETE from `tt_users` WHERE login = 'admin';
INSERT INTO `tt_users` (`login`, `password`, `name`, `group_id`, `role_id`) VALUES ('admin', md5('secret'), 'Admin', '0', (select id from tt_roles where rank = 1024));
PRIMARY KEY (`id`)
);
-# Create an index that guarantees unique invoice names per team.
+# Create an index that guarantees unique invoice names per group.
create unique index name_idx on tt_invoices(group_id, name, status);
PRIMARY KEY (`id`)
);
-# Create an index that guarantees unique active and inactive clients per team.
+# Create an index that guarantees unique active and inactive clients per group.
create unique index client_name_idx on tt_clients(group_id, name, status);
const TYPE_TEXT = 1; // A text field.
const TYPE_DROPDOWN = 2; // A dropdown field with pre-defined values.
- var $fields = array(); // Array of custom fields for team.
+ var $fields = array(); // Array of custom fields for group.
var $options = array(); // Array of options for a dropdown custom field.
// Constructor.
return false;
}
- // getFields returns an array of custom fields for team.
+ // getFields returns an array of custom fields for group.
static function getFields() {
global $user;
$mdb2 = getConnection();
return false;
}
- // The insertField inserts a custom field for team.
+ // The insertField inserts a custom field for group.
static function insertField($field_name, $field_type, $required) {
global $user;
$mdb2 = getConnection();
return (!is_a($affected, 'PEAR_Error'));
}
- // The updateField updates custom field for team.
+ // The updateField updates custom field for group.
static function updateField($id, $name, $type, $required) {
global $user;
$mdb2 = getConnection();
return (!is_a($affected, 'PEAR_Error'));
}
- // The deleteField deletes a custom field, its options and log entries for team.
+ // The deleteField deletes a custom field, its options and log entries for group.
static function deleteField($field_id) {
// Our overall intention is to keep the code simple and manageable.
return $numWorkdays * $user->workday_minutes;
}
- // getMany - returns an array of quotas for a given year for team.
+ // getMany - returns an array of quotas for a given year for group.
private function getMany($year){
$group_id = $this->group_id;
$sql = "SELECT month, minutes FROM tt_monthly_quotas WHERE year = $year AND group_id = $group_id";
require_once('initialize.php');
require_once('plugins/MonthlyQuota.class.php');
import('form.Form');
-import('ttTeamHelper');
import('ttTimeHelper');
// Access checks.
Project home page: https://www.anuko.com/time_tracker/index.htm
Forum: https://www.anuko.com/forum/viewforum.php?f=4
Info for developers: https://www.anuko.com/time_tracker/info_for_developers.htm
-Free hosting of Time Tracker for individuals and small teams is available at https://timetracker.anuko.com
+Free hosting of Time Tracker for individuals and small groups is available at https://timetracker.anuko.com
Unless otherwise noted, files in this archive are protected by the LIBERAL FREEWARE LICENSE.
Read the file license.txt for details.
6) Change $dsn value in /WEB-INF/config.php file to reflect your database connection parameters (user name and password).
7) If you are upgrading from earlier Time Tracker version run dbinstall.php from your browser and do only the required "Update database structure" steps.
8) If you install time tracker into a sub-directory of your site reflect this in the APP_NAME parameter in /WEB-INF/config.php file. For example, for http://localhost/timetracker/ set APP_NAME = "timetracker".
-9) Login to your time tracker site as admin with password "secret" without quotes and create at least one team.
+9) Login to your time tracker site as admin with password "secret" without quotes and create at least one group.
10) Change admin password (on the admin "options" page). You can also use the following SQL console command:
update tt_users set password = md5('new_password_here') where login='admin'
or by using the "Change password of administrator account" option in http://your_time_tracker_site/dbinstall.php
require_once('initialize.php');
import('form.Form');
-import('ttTeamHelper');
import('ttRoleHelper');
// Access check.
require_once('initialize.php');
import('form.Form');
-import('ttTeamHelper');
import('ttTimeHelper');
import('ttRoleHelper');
require_once('initialize.php');
import('form.Form');
-import('ttTeamHelper');
// Access checks.
if (!ttAccessAllowed('manage_advanced_settings')) {