/** * List all time total for a user (both billed and unbilled) * * @access public * @param void * @return null */ function byuser() { $this->setLayout('administration'); if (!logged_user()->isAdministrator(owner_company())) { flash_error(lang('no access permissions')); $this->redirectTo('dashboard'); } // if $user_id = (int) array_var($_GET, 'id', 0); if ($user_id < 0) { $user_id = 0; } $redirect_to = array_var($_GET, 'redirect_to'); if ($redirect_to == '') { $redirect_to = get_url('time', 'byuser', array('id' => $user_id)); $redirect_to = str_replace('&', '&', trim($redirect_to)); } // if $unbilled = ProjectTimes::getTimeByUserStatus(Users::findById($user_id)); $billed = ProjectTimes::getTimeByUserStatus(Users::findById($user_id), 1); tpl_assign('unbilled', $unbilled); tpl_assign('billed', $billed); tpl_assign('user', Users::findById($user_id)); tpl_assign('redirect_to', $redirect_to); $this->setSidebar(get_template_path('index_sidebar', 'time')); }
"><?php echo clean($user->getDisplayName()); ?> </a> </td> <td class="middle"> <?php echo ProjectTimes::getTimeByUserStatus($user, 0, 'hours'); ?> <?php echo lang('hrs'); ?> </td> <td class="middle"> <?php echo ProjectTimes::getTimeByUserStatus($user, 1, 'hours'); ?> <?php echo lang('hrs'); ?> </td> </tr> <?php } // foreach ?> </table> <?php } else { echo lang('no users in company'); }