]> wagnertech.de Git - timetracker.git/commitdiff
A bit more progress on subgroups.
authorNik Okuntseff <support@anuko.com>
Wed, 21 Nov 2018 08:49:12 +0000 (08:49 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 21 Nov 2018 08:49:12 +0000 (08:49 +0000)
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/group_edit.tpl
groups.php

index 6bac7cb468232b622ac728c9709e694ac346bb83..86174547eeedc0104a37e27ee029e6cbb6fca22b 100644 (file)
@@ -410,6 +410,20 @@ class ttUser {
     return $groups;
   }
 
+  // getSubgroups obtains a list of immediate subgroups.
+  function getSubgroups() {
+    $mdb2 = getConnection();
+
+    $sql = "select id, name from tt_groups where org_id = $this->org_id and parent_id = ".$this->getActiveGroup();;
+    $res = $mdb2->query($sql);
+    if (!is_a($res, 'PEAR_Error')) {
+      while ($val = $res->fetchRow()) {
+        $groups[] = array('id'=>$val['id'],'name'=>$val['name']);
+      }
+    }
+    return $groups;
+  }
+
   // 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) {
index 9a9be2d067f7316865ada6943966ad45b84abb94..53f93aceb0e0c767718bfd2459b38dc4d04d9756 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.18.25.4477 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <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> |
             <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 ef00ca4dbfa31a2705ceab95c7756f3ea247f970..ea46bec6f3799105aff5946b85c39af9123d0741 100644 (file)
@@ -41,6 +41,14 @@ function handleTaskRequiredCheckbox() {
             <td><a href="roles.php">{$i18n.label.configure}</a></td>
           </tr>
   {/if}
+{if $smarty.const.SUBGROUP_DEBUG == 'true'}
+  {if $user->can('manage_subgroups')}
+          <tr>
+            <td align="right" nowrap>{$i18n.label.subgroups}:</td>
+            <td><a href="groups.php">{$i18n.label.configure}</a></td>
+          </tr>
+  {/if}
+{/if}
           <tr>
            <td align="right" nowrap>{$i18n.label.language}:</td>
            <td>{$forms.groupForm.lang.control}</td>
index 5a612c130757b6c1ecf0cadfe399c80757cc2fed..12e54da20683a3b6d641017a22f4206e6c72b96b 100644 (file)
@@ -39,7 +39,7 @@ if (!ttAccessAllowed('manage_subgroups')) {
 }
 // End of access checks.
 
-$smarty->assign('groups', $user->getGroups());
-$smarty->assign('title', $i18n->get('title.groups'));
+$smarty->assign('groups', $user->getSubgroups());
+$smarty->assign('title', $i18n->get('label.subgroups'));
 $smarty->assign('content_page_name', 'groups.tpl');
 $smarty->display('index.tpl');