X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=reports.php;h=fc77e09109e5bd609e4ab2f95faab58a9a5ffd25;hb=343dfea2506d317ae99b965667e1b62ea4d83480;hp=107f8cee6cf8cf1c5d5b8f93619b05027c2299fb;hpb=eb1332ec4a8cc403d3531bd472e9060dfe5e5d94;p=timetracker.git diff --git a/reports.php b/reports.php index 107f8cee..fc77e091 100644 --- a/reports.php +++ b/reports.php @@ -178,10 +178,22 @@ if ($showPaidStatus) { )); } +// Add approved / not approved selector. +$showApproved = $user->isPluginEnabled('ap') && + ($user->can('view_own_reports') || $user->can('view_reports') || + $user->can('view_all_reports') || ($user->can('view_client_reports') && $user->can('view_client_unapproved'))); +if ($showApproved) { + $form->addInput(array('type'=>'combobox', + 'name'=>'approved', + 'style'=>'width: 250px;', + 'data'=>array('1'=>$i18n->get('dropdown.approved'),'2'=>$i18n->get('dropdown.not_approved')), + 'empty'=>array(''=>$i18n->get('dropdown.all')) + )); +} + // Add timesheet assignment selector. $showTimesheetDropdown = $user->isPluginEnabled('ts') && - ($user->can('view_own_timesheets') || $user->can('view_timesheets') || - $user->can('view_all_timesheets') || ($user->can('view_client_timesheets') && $user->can('view_client_unapproved'))); + ($user->can('view_own_timesheets') || $user->can('view_timesheets') || $user->can('view_all_timesheets')); if ($showTimesheetDropdown) { $form->addInput(array('type'=>'combobox', 'name'=>'timesheet', @@ -195,21 +207,7 @@ if ($showTimesheetDropdown) { )); } $showTimesheetCheckbox = $user->isPluginEnabled('ts') && - ($user->can('view_own_timesheets') || $user->can('view_timesheets') || - $user->can('view_all_timesheets') || $user->can('view_client_timesheets')); - -// Add approved / not approved selector. -$showApproved = $user->isPluginEnabled('ap') && - ($user->can('view_own_reports') || $user->can('view_reports') || - $user->can('view_all_reports') || ($user->can('view_client_reports') && $user->can('view_client_unapproved'))); -if ($showApproved) { - $form->addInput(array('type'=>'combobox', - 'name'=>'approved', - 'style'=>'width: 250px;', - 'data'=>array('1'=>$i18n->get('dropdown.approved'),'2'=>$i18n->get('dropdown.not_approved')), - 'empty'=>array(''=>$i18n->get('dropdown.all')) - )); -} + ($user->can('view_own_timesheets') || $user->can('view_timesheets') || $user->can('view_all_timesheets')); // Add user table. $showUsers = $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient(); @@ -336,20 +334,26 @@ if ($request->isGet() && !$bean->isSaved()) { $period = new Period(INTERVAL_THIS_MONTH, new DateAndTime($user->getDateFormat())); $form->setValueByElement('start_date', $period->getStartDate()); $form->setValueByElement('end_date', $period->getEndDate()); + $form->setValueByElement('chclient', '1'); - $form->setValueByElement('chinvoice', '0'); - $form->setValueByElement('chpaid', '0'); - $form->setValueByElement('chip', '0'); - $form->setValueByElement('chproject', '1'); $form->setValueByElement('chstart', '1'); + $form->setValueByElement('chfinish', '1'); $form->setValueByElement('chduration', '1'); - $form->setValueByElement('chcost', '0'); + + $form->setValueByElement('chproject', '1'); $form->setValueByElement('chtask', '1'); - $form->setValueByElement('chfinish', '1'); $form->setValueByElement('chnote', '1'); + $form->setValueByElement('chcost', '0'); + + $form->setValueByElement('chtimesheet', '0'); + $form->setValueByElement('chip', '0'); + $form->setValueByElement('chapproved', '0'); + $form->setValueByElement('chpaid', '0'); + $form->setValueByElement('chcf_1', '0'); $form->setValueByElement('chunits', '0'); - $form->setValueByElement('chtimesheet', '0'); + $form->setValueByElement('chinvoice', '0'); + $form->setValueByElement('chtotalsonly', '0'); }