public function viewinvoiceAction() { $this->getResponse()->setHeader('Content-type', 'text/plain'); $invoice = $this->byId(); $timesheet = $this->projectService->getTimesheet($invoice->timesheetid); if (!$timesheet) { throw new Exception("Must have a timesheet to view invoice"); } $project = $this->projectService->getProject((int) $invoice->projectid); $this->view->client = $this->clientService->getClient($project->clientid); $this->view->invoice = $invoice; $timesheet->to = date('Y-m-d 23:59:59', strtotime($timesheet->to)); // $this->view->tasks = $this->projectService->getTasks(array("projectid=" => $project->id)); $this->view->records = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, $timesheet->id, $timesheet->from, $timesheet->to); $this->view->project = $project; $this->renderRawView('invoice/view.php'); }
/** * Get the timesheet for this project * */ public function timesheetAction() { $project = $this->projectService->getProject($this->_getParam('projectid')); $client = $this->clientService->getClient($this->_getParam('clientid')); if (!$project && !$client) { return; } if ($project) { $start = date('Y-m-d', strtotime($project->started) - 86400); $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null); } else { $start = date('Y-m-d', strtotime($client->created)); $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null); } $this->renderRawView('timesheet/ajax-timesheet-summary.php'); }