Exemplo n.º 1
0
$T->set_var('end_date', $end_date);
$T->set_var('emp', $emp);
$T->set_var('disable', "display:none");
$T->set_var('disable_on_lock', " readonly ");
$T->set_var('comment_disable', '');
$T->set_var('comment_edit_disable', '');
$adjustment_save = $ts->determineIfItemIsInLockRangeByDateStamp($startStamp, $emp) ? '_adj' : '';
$T->set_var('adj_postfix', $adjustment_save);
$T->parse('output', 'javascript');
if ($hideapproved) {
    $T->set_var('hidefullyapproved_check', 'checked');
}
if ($emp > 0) {
    //specific user
    //first, detect if they should be seeing this user's timesheets
    $shouldBeApproving = $ts->testIfUserCanApprove($uid, $emp);
    if (!$shouldBeApproving) {
        echo $LANG_NEXTIME['should_not_be_approving'];
        echo COM_siteFooter();
        exit(0);
    }
    if ($showAsTimesheet == 1) {
        $output = '';
        if (SEC_inGroup('nexTime Finance') && !SEC_inGroup('Root')) {
            //disable it all
            $T->set_var('comment_disable', ' disabled ');
            $T->set_var('comment_edit_disable', 'display:none');
            $output .= $ts->generateTableHeader(true, true, $ts->determineIfItemIsInLockRangeByDateStamp($startStamp, $emp));
            $retval = $ts->generateTimesheetRows($emp, $startStamp, $numberOfDays, null, 0, true, true);
            $output .= $retval[1];
            $output .= $ts->generateTableFooter(true, $retval[2], $retval[3], $retval[4], $retval[5], $ts->determineIfItemIsInLockRangeByDateStamp($startStamp, $emp));