X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=time_edit.php;h=5f4068829822f7100447a0b23936754bd34a1b0f;hb=1c55e1b9d6da2173f7e946011908c02dd80df26d;hp=507f28abb7848292ee1962d0154dc1dd7194bb1f;hpb=11bfec0ff88b649a934556e8b4812d65715c7509;p=timetracker.git diff --git a/time_edit.php b/time_edit.php index 507f28ab..5f406882 100644 --- a/time_edit.php +++ b/time_edit.php @@ -51,7 +51,7 @@ if (!$time_rec || $time_rec['invoice_id']) { // Use custom fields plugin if it is enabled. if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); - $custom_fields = new CustomFields($user->team_id); + $custom_fields = new CustomFields($user->group_id); $smarty->assign('custom_fields', $custom_fields); } @@ -110,7 +110,7 @@ $form = new Form('timeRecordForm'); // Dropdown for clients in MODE_TIME. Use all active clients. if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { - $active_clients = ttTeamHelper::getActiveClients($user->team_id, true); + $active_clients = ttTeamHelper::getActiveClients($user->group_id, true); $form->addInput(array('type'=>'combobox', 'onchange'=>'fillProjectDropdown(this.value);', 'name'=>'client', @@ -136,7 +136,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t // Dropdown for clients if the clients plugin is enabled. if ($user->isPluginEnabled('cl')) { - $active_clients = ttTeamHelper::getActiveClients($user->team_id, true); + $active_clients = ttTeamHelper::getActiveClients($user->group_id, true); // We need an array of assigned project ids to do some trimming. foreach($project_list as $project) $projects_assigned_to_user[] = $project['id']; @@ -164,7 +164,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t } if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { - $task_list = ttTeamHelper::getActiveTasks($user->team_id); + $task_list = ttTeamHelper::getActiveTasks($user->group_id); $form->addInput(array('type'=>'combobox', 'name'=>'task', 'style'=>'width: 250px;', @@ -206,7 +206,7 @@ if ($custom_fields && $custom_fields->fields[0]) { $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id)); if ($user->isPluginEnabled('iv')) $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable)); -if ($user->canManageTeam() && $user->isPluginEnabled('ps')) +if ($user->can('manage_invoices') && $user->isPluginEnabled('ps')) $form->addInput(array('type'=>'checkbox','name'=>'paid','value'=>$cl_paid)); $form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save or btn_copy click. $form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.save'))); @@ -365,6 +365,7 @@ if ($request->isPost()) { $id = ttTimeHelper::insert(array( 'date'=>$new_date->toString(DB_DATEFORMAT), 'user_id'=>$user->getActiveUser(), + 'group_id'=>$user->getActiveGroup(), 'client'=>$cl_client, 'project'=>$cl_project, 'task'=>$cl_task,