Subgroups

Discussion forum about Anuko Time Tracker
Post Reply
Nik
Posts: 479
Joined: Wed May 26, 2010 5:55 pm

Subgroups

Post by Nik » Fri Nov 02, 2018 8:31 pm

I am starting to work on subgroup support in Time Tracker.

This thread is to discuss this feature and suggest ideas or raise concerns about it.

In a nutshell, I plan to consider an organization (identified by org_id field) consisting of a tree of groups of users (identified by group_id). Each group has a parent_id, which is null for top level groups.

To keep things simple, each subgroup is totally independent. Everything works like now. But users from a parent group having the manage_subgroups right can enter a subgroup and assume fuil control. I plan to accomplish this via an additional dropdown on top of some pages, which will allow for simple navigation between groups. Similarly to how we select an on-behalf user now.

Question arises about access checks and rights to a subgroup. Proposed approach is:

- Maintain parent user access rights and rank as is in its home group, how it works now.
- If user has manage_subgroups - allow navigation down the organizational tree (but not up) keeping access rights intact.
- If a parent user is in a subgroup - adjust its effective rank to maximum so that access to all users data in a subgroup becomes possible. This access is limited according to a set of rights the parent user has. For example, if the parent use can do something with regards to other users (such as track_time, then it applies to all users in all subgroups down. But if the parent user cannot do something in home group, they cannot do it anywhere.

This approach shall allow us to use the same set of functions in subgroups, without writing new code. Consider the following situation: user logins to Time Tracker, gets redirected to time.php, where we see a subgroup selector and a user selector. On initial entry the group list is a home group plus all immediate subgroups, and the user list is the list of users from the home group (adjusted for user rank accordingly). After navigating into subgroup, the group list changes to include parent group, current group, and all immediate children groups, while the user list now contains ALL users from the currently selected subgroup (as user rank is now set to max in context of a subgroup). To populate group list we will use getGroups function. For users: getUsers. The same functions are used for home group or subgroups. Adjusting effective rank accordingly in subgroups allows us to get a complete list of subgroup users (not filtered down according to original user rank).

This is a risky feature. Among other things, export-import needs a revamp to accommodate subgroups.

Nik
Posts: 479
Joined: Wed May 26, 2010 5:55 pm

Re: Subgroups

Post by Nik » Thu Nov 08, 2018 11:01 pm

With regard to export-import, as it is currently being re-written, both export and import will be re-designed, and the format of the XML will change for us to be able to incorporate subgroups nicely.

XML format will change to something properly nested like this example:

Code: Select all

<?xml version="1.0"?>
<org>
  <group name="Parent Group" ... >
    <roles>
      <role id="1" name="User" ... ></role>
      <role id="1" name="Supervisor" ... ></role>
    </roles>
    <users>
      <user id="1" name="parent" login="parent" ...</user>
      <user id="2" name="user_1_in_parent" login="user_1_in_parent" ...</user>
    </users>
    <group name="Child Group" currency="$" lang="en">
      <roles>
        <role id="1" name="User" ...></role>
      </roles>
      <users>
        <user id="1" name="child" login="child" ...</user>
      </users>
    </group>
  </group>
</org>
Notice how group elements are located inside one another with everything else inside group node.

I plan to use recursion to export groups one at a time to a file.

New import now has to do 2 passes through the file:

1) To determine if we have a login collision - need to parse all groups for that (in other words the entire file as groups are nested within one another).
2) Do import of data in the second pass.

To be able to do import in ONE second pass and easy, the order of entities in the XML must start with roles section and build upon it adding more entities as we go along and be able to insert data into the database as we parse each tag.

For example, as user has a role_id and an optional client_id, therefore we must have roles and clients in XML first (before users), and so on. I will add more details as things become more clear. For now, the order in each group:

Code: Select all

roles
tasks
projects
clients
users
other entities
nested groups in the end
Another thing is getting rid of CDATA sections in XML entirely. This will allow us to consolidate ALL processing at tag start - which should improve maintainability of the entire import code. The idea is to keep things simple: hop along the file processing start tags only, collect all attributes from within and do database inserts right there. New file format described above makes sure that we can prepare all required mappings for entities (between database and xml ids) right before we process each new tag. For example, we have roles and clients imported already before we start with users and other things.

Nik
Posts: 479
Joined: Wed May 26, 2010 5:55 pm

Re: Subgroups

Post by Nik » Sat Dec 15, 2018 6:10 pm

Subgroups feature is implemented in Time Tracker version 1.18.31.4651. Subgroups can be added on the Subgroups page see attachment.


subgroups_menu.png
subgroups_menu.png (57.65 KiB) Viewed 1733 times

To navigate between groups - use the Group selector on either Group or Subgroups page. It shows up only when subgroups are available and navigation is possible.


group_selector_in_time_tracker.png
group_selector_in_time_tracker.png (44.36 KiB) Viewed 1733 times

mark.shultz.iowa
Posts: 1
Joined: Thu Dec 20, 2018 6:28 pm

Re: Subgroups

Post by mark.shultz.iowa » Thu Dec 20, 2018 6:35 pm

Hello,
I just started using Time Tracker, and it looks like it's 95% of what I'm looking for. I was working with Sub Groups and was wondering if it would be a possibility for a user that's higher in the hierarchy of groups to be a member of the subgroups below and be able to enter time. Here's my usage scenario:

We have employees that work hourly and we need to track their time for payroll purposes (Just time, with punches)
We have employees that work on commission, but we need to track their billable time on projects and by task. The employees that work hourly also need to be able to bill time to projects and tasks. In addition, we have different sets of tasks that depend on what type of project they're doing.

My thought was to build out the sub groups with the different options above (1 for just time with punches, and then a sub group for each set of differing tasks). I would want all users to be able to log time in any of the sub groups that are below where the user is defined. So if a user is defined in the top group, they could log time in any subgroup, but if the user is defined in a lower sub group, they could only enter time in that sub group and groups below them.

Would something like this be possible?

wrc
Posts: 280
Joined: Tue May 25, 2010 8:30 pm

Re: Subgroups

Post by wrc » Thu Dec 20, 2018 10:23 pm

mark.shultz.iowa wrote:
Thu Dec 20, 2018 6:35 pm
We have employees that work hourly and we need to track their time for payroll purposes (Just time, with punches)

We have employees that work on commission, but we need to track their billable time on projects and by task. The employees that work hourly also need to be able to bill time to projects and tasks. In addition, we have different sets of tasks that depend on what type of project they're doing.

My thought was to build out the sub groups with the different options above (1 for just time with punches, and then a sub group for each set of differing tasks). I would want all users to be able to log time in any of the sub groups that are below where the user is defined. So if a user is defined in the top group, they could log time in any subgroup, but if the user is defined in a lower sub group, they could only enter time in that sub group and groups below them.

Would something like this be possible?
Why do you need subgroups? What exactly is not working now with all users in one group? I only see a complication with "Project required" in Projects and Tasks tracking mode. If project were not required, you could also punch in time without specifying either a project or a task. I mean they would both be optional. Now only the task is optional.

admin
Posts: 558
Joined: Fri Oct 08, 2004 9:46 pm
Location: Vancouver, Canada
Contact:

Re: Subgroups

Post by admin » Sat Dec 22, 2018 2:00 pm

mark.shultz.iowa wrote:
Thu Dec 20, 2018 6:35 pm
We have employees that work hourly and we need to track their time for payroll purposes (Just time, with punches)
We have employees that work on commission, but we need to track their billable time on projects and by task. The employees that work hourly also need to be able to bill time to projects and tasks. In addition, we have different sets of tasks that depend on what type of project they're doing.
You can associate tasks with specific projects on project edit page.

If a specific customization is required, we most likely can do it on a dedicated hosting we provide. Contact for pricing if necessary,

Based on your description, it does not look like you need subgroups, unless I am missing something.

In case you need to restrict some employees to punch-in mode only, this can be accomplished via a customized role in group.

Semper
Posts: 17
Joined: Mon May 20, 2019 6:25 pm

Re: Subgroups

Post by Semper » Wed May 22, 2019 6:59 pm

The Subgroups feature is really useful. Thank you.

I would like to make Reports using the "Top Manager" on all the users in all the Subgroups in one go, so that if I have 10 Subgroups and I am the Top Manager I don't have to manually make 10 Reports to find out what all the users on all the Subgroups did today or this week. Is this possible?

wrc
Posts: 280
Joined: Tue May 25, 2010 8:30 pm

Re: Subgroups

Post by wrc » Thu May 23, 2019 1:01 pm

Semper wrote:
Wed May 22, 2019 6:59 pm
The Subgroups feature is really useful. Thank you.

I would like to make Reports using the "Top Manager" on all the users in all the Subgroups in one go, so that if I have 10 Subgroups and I am the Top Manager I don't have to manually make 10 Reports to find out what all the users on all the Subgroups did today or this week. Is this possible?
Well, there are multiple challenges with doing this.

- Groups are independent with its own settings, report options that apply to one do not necessarily match other groups.
- Scalability. 10 subgroups is fine, but a 1000 is probably not.

Semper
Posts: 17
Joined: Mon May 20, 2019 6:25 pm

Re: Subgroups

Post by Semper » Fri Jun 07, 2019 9:30 pm

wrc wrote:
Thu May 23, 2019 1:01 pm
Semper wrote:
Wed May 22, 2019 6:59 pm
The Subgroups feature is really useful. Thank you.

I would like to make Reports using the "Top Manager" on all the users in all the Subgroups in one go, so that if I have 10 Subgroups and I am the Top Manager I don't have to manually make 10 Reports to find out what all the users on all the Subgroups did today or this week. Is this possible?
Well, there are multiple challenges with doing this.

- Groups are independent with its own settings, report options that apply to one do not necessarily match other groups.
- Scalability. 10 subgroups is fine, but a 1000 is probably not.
The scalability problem I'm not worried about (as an user with the "view_own_reports" right already can, for example, make a report of his own data since 10-years-ago, but that is supposed not to be a common scenario). Anyway, it would be fine if reporting on Subgroups by the Top-Manager was restricted to a maximum of 20 Subgroups (as I don't foresee ever having more than 5 or 6 subgroups).

About the Subgroups potentially having its own configuration different from the root-group configuration... Yeah, could happen. But not in my scenario, where TimeTracker is to be used as a Punch IN-OUT system. So It would be great if, when the Top-Manager is making a Report, we could have a check-box like "if you selected Report-all-users, then also report the same about all Users on all Subgroups", regardless of what those Subgroups may be configured as. Could this be done?

Post Reply