From 9def341e72ae78b8d0cb96ce425cdfb6824b00b6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 2 Nov 2018 08:34:18 +0000 Subject: [PATCH] Some work in progress on subgroups. --- WEB-INF/lib/ttUser.class.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 65a1f596..9ce67ac0 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -70,7 +70,7 @@ class ttUser { var $is_client = false; // Whether user is a client as determined by missing 'track_own_time' right. var $minutes_in_unit = 15; // Number of minutes in unit for Work units plugin. var $first_unit_threshold = 0;// Threshold for 1st unit for Work units plugin. - var $unit_totals_only = 0; // Totlas only option for the Work units plugin. + var $unit_totals_only = 0; // Totals only option for the Work units plugin. // Constructor. function __construct($login, $id = null) { @@ -361,6 +361,22 @@ class ttUser { return $user_list; } + // getGroups obtains an array consisting of: + // - A parent group (..) of a currently selected group, if available. + // - A currently selected group (.) represented by $behalf_group_id. + // - All subgroups (only immediate children) of a currently selected group. + function getGroups($options) { + $mdb2 = getConnection(); + + // $sql = 'select id, parent_id, name from tt_groups where org_id = $this->org_id ...'; // TODO: parent_id is now NULL in db, fix this. + // Step 1: Get parent group (sql query). + // Step 2: Get current group from the class. + // Step 3: Get immediate subgroups (sql query). + // Populate an array and return it, + + return false; // Work in progress here... + } + // getUser function is used to manage users in group and returns user details. // At the moment, the function is used for user edits and deletes. function getUser($user_id) { -- 2.20.1