X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=reports.php;h=3aba9cdf7c9c4414dadab3d5d993b20a725381ea;hb=82113b6a111dc3f716c71fb8fb55b11845cbd697;hp=3a7367e77e6653f29948955f0d6fbb354a8e160e;hpb=030d2c3ffbf8229cc945427e9e9f7704226effe1;p=timetracker.git diff --git a/reports.php b/reports.php index 3a7367e7..3aba9cdf 100644 --- a/reports.php +++ b/reports.php @@ -122,16 +122,6 @@ $form->addInput(array('type'=>'combobox', 'data'=>$include_options, 'empty'=>array(''=>$i18n->get('dropdown.all')))); -if ($user->canManageTeam() && $user->isPluginEnabled('ps')) { - $form->addInput(array('type'=>'combobox', - 'name'=>'paid_status', - 'style'=>'width: 250px;', - 'data'=>array('1'=>$i18n->get('dropdown.paid'),'2'=>$i18n->get('dropdown.not_paid')), - 'empty'=>array(''=>$i18n->get('dropdown.all')) - )); -} - - // Add invoiced / not invoiced selector. $invoice_options = array('1'=>$i18n->get('form.reports.include_invoiced'), '2'=>$i18n->get('form.reports.include_not_invoiced')); @@ -141,11 +131,25 @@ $form->addInput(array('type'=>'combobox', 'data'=>$invoice_options, 'empty'=>array(''=>$i18n->get('dropdown.all')))); +if ($user->canManageTeam() && $user->isPluginEnabled('ps')) { + $form->addInput(array('type'=>'combobox', + 'name'=>'paid_status', + 'style'=>'width: 250px;', + 'data'=>array('1'=>$i18n->get('dropdown.paid'),'2'=>$i18n->get('dropdown.not_paid')), + 'empty'=>array(''=>$i18n->get('dropdown.all')) + )); +} + $user_list = array(); -if ($user->canManageTeam() || $user->isClient()) { +if ($user->can('view_reports') || $user->isClient()) { // Prepare user and assigned projects arrays. - if ($user->canManageTeam()) - $users = ttTeamHelper::getUsers(); // Active and inactive users for managers. + if ($user->can('view_reports')) { + if ($user->can('view_own_reports')) + $options = array('max_rank'=>$user->rank-1,'include_self'=>true); + else + $options = array('max_rank'=>$user->rank-1); + $users = $user->getUsers($options); // Active and inactive users. + } elseif ($user->isClient()) $users = ttTeamHelper::getUsersForClient(); // Active and inactive users for clients.