Adjusted task_add.php and task_edit.php to operate with subgroups.
[timetracker.git] / time.php
index 68aaf40..ae17aa0 100644 (file)
--- a/time.php
+++ b/time.php
@@ -107,9 +107,9 @@ $_SESSION['task'] = $cl_task;
 // Elements of timeRecordForm.
 $form = new Form('timeRecordForm');
 
-if (defined('SUBGROUP_DEBUG') && isTrue(SUBGROUP_DEBUG)) {
+if (isTrue(SUBGROUP_DEBUG)) {
 if ($user->can('manage_subgroups')) {
-  $groups = $user->getGroups();
+  $groups = $user->getGroupsForDropdown();
   if (count($groups) > 1) {
     $form->addInput(array('type'=>'combobox',
       'onchange'=>'this.form.submit();',
@@ -312,7 +312,7 @@ if ($request->isPost()) {
       $id = ttTimeHelper::insert(array(
         'date' => $cl_date,
         'user_id' => $user->getActiveUser(),
-        'group_id' => $user->getActiveGroup(),
+        'group_id' => $user->getGroup(),
         'org_id' => $user->org_id,
         'client' => $cl_client,
         'project' => $cl_project,