]> wagnertech.de Git - timetracker.git/commitdiff
A bit of cleanup.
authorNik Okuntseff <support@anuko.com>
Mon, 9 Apr 2018 13:18:27 +0000 (13:18 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 9 Apr 2018 13:18:27 +0000 (13:18 +0000)
19 files changed:
WEB-INF/lib/ttNotificationHelper.class.php
WEB-INF/lib/ttTeamHelper.class.php
WEB-INF/lib/ttUser.class.php
WEB-INF/lib/ttUserHelper.class.php
WEB-INF/resources/it.lang.php
WEB-INF/templates/admin_groups.tpl
WEB-INF/templates/footer.tpl
admin_groups.php
dbinstall.php
locking.php
mobile/users.php
mysql.sql
plugins/CustomFields.class.php
plugins/MonthlyQuota.class.php
quotas.php
readme.txt
role_add.php
users.php
week_view.php

index 34c8527696769be1d38c2f380669b959563102c2..35a96970eb351ce4db39cd797b1f025e3fb10560 100644 (file)
@@ -26,9 +26,6 @@
 // | https://www.anuko.com/time_tracker/credits.htm
 // +----------------------------------------------------------------------+
 
-import('ttTeamHelper');
-import('ttUserHelper');
-
 // Class ttNotificationHelper is used to help with notification related tasks.
 class ttNotificationHelper {
        
index 092c737ab530643efc60933f24d3bf451389ff1c..359f6b97736f261e2c31289618a88e9e59432d08 100644 (file)
@@ -354,7 +354,7 @@ class ttTeamHelper {
     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();
@@ -833,12 +833,12 @@ class ttTeamHelper {
     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";
@@ -848,20 +848,20 @@ class ttTeamHelper {
     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();
@@ -873,7 +873,7 @@ class ttTeamHelper {
     }
     $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'));
@@ -889,7 +889,7 @@ class ttTeamHelper {
       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'";
@@ -905,7 +905,7 @@ class ttTeamHelper {
     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();
 
@@ -957,7 +957,7 @@ class ttTeamHelper {
     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";
@@ -981,7 +981,7 @@ class ttTeamHelper {
     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";
@@ -1005,7 +1005,7 @@ class ttTeamHelper {
     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";
index cbfd62d1a262a4054e411441ed7c8d8955c1dc9d..7afc9c15c1174e1b9a61fc033aaa7384736fe7d5 100644 (file)
@@ -58,7 +58,7 @@ class ttUser {
   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.
@@ -153,7 +153,7 @@ class ttUser {
     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.
@@ -161,7 +161,7 @@ class ttUser {
                                       // 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'));
index 40cd7829313278b2e0ebef2a338c501cce64ec44..3d4ead9fe4bbcca15f8ea67047c14723f9057a61 100644 (file)
@@ -246,7 +246,7 @@ class ttUserHelper {
 
     // 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()) {
@@ -317,7 +317,7 @@ class ttUserHelper {
         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'))
index 67af31615dff9974c73df6992a12b67676b738a1..8a62db50fb111c96361b47e017cb4008ee039a6f 100644 (file)
@@ -46,7 +46,7 @@ $i18n_key_words = array(
 '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',
index ebe889914b156b70714497b967e04bab9656222c..e0a8aa2c68915d8bfba20e7a94bb246533deae08 100644 (file)
     <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}
index 90acc0600f133106c82864ac593fa4bcd62fb3e9..270660828a978396094bb71eac2c076b8b7f9626 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.87.4243 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.87.4244 | Copyright &copy; <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>
index fa5f51b21c64d320a64caf136e7513f47d9bade0..78e083ca59be3bfa808c6dec63da5780ea7a8be8 100644 (file)
@@ -36,7 +36,7 @@ if (!ttAccessAllowed('administer_site')) {
 }
 // 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');
index 63dee9c78f7c7bf416288d3e2c4b357cf591cf77..fb5e0317f38be0ac082454c783b44adcb0b00bf6 100644 (file)
@@ -900,7 +900,7 @@ if ($_POST) {
   if ($_POST["cleanup"]) {
 
     $mdb2 = getConnection();
-    $inactive_teams = ttTeamHelper::getInactiveTeams();
+    $inactive_teams = ttTeamHelper::getInactiveGroups();
 
     $count = count($inactive_teams);
     print "$count inactive teams found...<br>\n";
index 94996ada3035dcc9c199bea8f52451b0e89530c2..4359f2197550e73d0690d933bca16be3249016eb 100644 (file)
@@ -28,7 +28,6 @@
 
 require_once('initialize.php');
 import('form.Form');
-import('ttTeamHelper');
 
 // Access checks.
 if (!ttAccessAllowed('manage_advanced_settings')) {
index b531d7a49c42c9aa998abbbd2851b96764a617fb..d0b5d2189eeb33f4ede6ac55a0fb2584c48a6c76 100644 (file)
@@ -45,7 +45,7 @@ if($user->can('manage_users')) {
   $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) {
index 3673d29585df224eb814e5f827543ea20586a07f..87f67755735406a6c9653a579e49d8df9542d99e 100644 (file)
--- a/mysql.sql
+++ b/mysql.sql
@@ -9,7 +9,7 @@
 
 
 #
-# 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` (
@@ -29,7 +29,7 @@ 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
@@ -47,7 +47,7 @@ CREATE TABLE `tt_groups` (
 
 
 #
-# 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.
@@ -55,13 +55,11 @@ CREATE TABLE `tt_roles` (
   `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.
@@ -105,7 +103,7 @@ CREATE TABLE `tt_users` (
 # 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));
 
@@ -221,7 +219,7 @@ CREATE TABLE `tt_invoices` (
   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);
 
 
@@ -306,7 +304,7 @@ CREATE TABLE `tt_clients` (
   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);
 
 
index afb59dae941cc47286e815392dbad09ed9a191ee..00582e3e9fe4f39f47c4a2c74fa9fff876902713 100644 (file)
@@ -33,7 +33,7 @@ class CustomFields {
   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.
@@ -223,7 +223,7 @@ class CustomFields {
     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();
@@ -270,7 +270,7 @@ class CustomFields {
     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();
@@ -279,7 +279,7 @@ class CustomFields {
     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();
@@ -288,7 +288,7 @@ class CustomFields {
     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.
index de1f7cd201069758d28f647b333f182fdd63783d..5a4e70798ee2c2fe6c92f00060af0bca45f3ea22 100644 (file)
@@ -81,7 +81,7 @@ class MonthlyQuota {
     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";
index ac6542f5e90dbd99b0e1d436efa468471b6275ca..8381c3b6a3185b76d6ccf4fe351f4c1c6b32b07c 100644 (file)
@@ -29,7 +29,6 @@
 require_once('initialize.php');
 require_once('plugins/MonthlyQuota.class.php');
 import('form.Form');
-import('ttTeamHelper');
 import('ttTimeHelper');
 
 // Access checks.
index 82bda02639d419d3c1fdc1f00d12200741668c51..fd2e78b3330b508d9ef01c88200727436f6fd3de 100644 (file)
@@ -4,7 +4,7 @@ Copyright (c) Anuko (https://www.anuko.com)
 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.
@@ -30,7 +30,7 @@ The general installation procedure looks like this:
 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
index 086da632c9a71001e0707b5a3198678133e54524..c8df24c732a09aec6cb5e24273e867a90160c1dd 100644 (file)
@@ -28,7 +28,6 @@
 
 require_once('initialize.php');
 import('form.Form');
-import('ttTeamHelper');
 import('ttRoleHelper');
 
 // Access check.
index d20617bca4b567080f247e87fc34cdd3726280ca..b7a6606ca5a61df2b808a6a88002ed00c604840a 100644 (file)
--- a/users.php
+++ b/users.php
@@ -28,7 +28,6 @@
 
 require_once('initialize.php');
 import('form.Form');
-import('ttTeamHelper');
 import('ttTimeHelper');
 import('ttRoleHelper');
 
index 38b753a15554aa03eebf78d54a2930b7522b13df..9f809af3cf7d151bb7a4539cb75e7fccb7379d55 100644 (file)
@@ -28,7 +28,6 @@
 
 require_once('initialize.php');
 import('form.Form');
-import('ttTeamHelper');
 
 // Access checks.
 if (!ttAccessAllowed('manage_advanced_settings')) {