Skip to content
This repository was archived by the owner on Sep 6, 2026. It is now read-only.

Commit d6a5ffe

Browse files
committed
A bit more progress on subgroups.
1 parent a4fd787 commit d6a5ffe

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

WEB-INF/lib/ttUser.class.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,20 @@ function getGroups() {
410410
return $groups;
411411
}
412412

413+
// getSubgroups obtains a list of immediate subgroups.
414+
function getSubgroups() {
415+
$mdb2 = getConnection();
416+
417+
$sql = "select id, name from tt_groups where org_id = $this->org_id and parent_id = ".$this->getActiveGroup();;
418+
$res = $mdb2->query($sql);
419+
if (!is_a($res, 'PEAR_Error')) {
420+
while ($val = $res->fetchRow()) {
421+
$groups[] = array('id'=>$val['id'],'name'=>$val['name']);
422+
}
423+
}
424+
return $groups;
425+
}
426+
413427
// getUser function is used to manage users in group and returns user details.
414428
// At the moment, the function is used for user edits and deletes.
415429
function getUser($user_id) {

WEB-INF/templates/footer.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<br>
1313
<table cellspacing="0" cellpadding="4" width="100%" border="0">
1414
<tr>
15-
<td align="center">&nbsp;Anuko Time Tracker 1.18.25.4477 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
15+
<td align="center">&nbsp;Anuko Time Tracker 1.18.25.4478 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
1616
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
1717
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
1818
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>

WEB-INF/templates/group_edit.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ function handleTaskRequiredCheckbox() {
4141
<td><a href="roles.php">{$i18n.label.configure}</a></td>
4242
</tr>
4343
{/if}
44+
{if $smarty.const.SUBGROUP_DEBUG == 'true'}
45+
{if $user->can('manage_subgroups')}
46+
<tr>
47+
<td align="right" nowrap>{$i18n.label.subgroups}:</td>
48+
<td><a href="groups.php">{$i18n.label.configure}</a></td>
49+
</tr>
50+
{/if}
51+
{/if}
4452
<tr>
4553
<td align="right" nowrap>{$i18n.label.language}:</td>
4654
<td>{$forms.groupForm.lang.control}</td>

groups.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040
// End of access checks.
4141

42-
$smarty->assign('groups', $user->getGroups());
43-
$smarty->assign('title', $i18n->get('title.groups'));
42+
$smarty->assign('groups', $user->getSubgroups());
43+
$smarty->assign('title', $i18n->get('label.subgroups'));
4444
$smarty->assign('content_page_name', 'groups.tpl');
4545
$smarty->display('index.tpl');

0 commit comments

Comments
 (0)