/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function createAction($owner_path, $project_path) { $project = Project::findByPath($owner_path, $project_path); $commentData = Request::get('comment'); try { $commentData['author_id'] = Auth::user()->id; $commentData['project_id'] = $project->id; $comment = $this->dispatchFromArray(AddCommentCommand::class, $commentData); } catch (ValidationException $e) { return Redirect::route('projects.issue_show', ['owner' => $owner_path, 'project' => $project_path, 'issue' => $commentData['target_id']])->withInput(Request::all())->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.issues.new.failure')))->withErrors($e->getMessageBag()); } return Redirect::route('projects.issue_show', ['owner' => $owner_path, 'project' => $project_path, 'issue' => $commentData['target_id']])->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.issues.new.success'))); }
public function updateAction($owner_path, $project_path, Issue $issue) { $project = Project::findByPath($owner_path, $project_path); $issueData = Request::get('issue'); try { $issueData['author_id'] = Auth::user()->id; $issueData['project_id'] = $project->id; $issueData['issue'] = $issue; $issue = $this->dispatchFromArray(UpdateIssueCommand::class, $issueData); } catch (ValidationException $e) { return Redirect::route('projects.issue_edit', ['owner' => $owner_path, 'project' => $project_path, 'issue' => $issue->id])->withInput(Request::all())->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.issues.edit.failure')))->withErrors($e->getMessageBag()); } //Do nothing /* if ($issue->project) { $issue->project->update(['status' => Request::get('project_status')]); } */ return Redirect::route('projects.issue_edit', ['owner' => $owner_path, 'project' => $project_path, 'issue' => $issue->id])->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.issues.edit.success'))); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function indexAction($namespace, $project_path) { $project = Project::findByPath($namespace, $project_path); return View::make('projects.pulse.index')->withProject($project)->withWikis([])->withActiveItem($this->active_item)->withPageTitle(sprintf('%s - %s', trans('dashboard.issues.issues'), $project->name)); }
/** * Show the form for editing the specified resource. * * @param string $owner_path * @param string $project_path * * @return \Illuminate\Http\Response */ public function editAction($owner_path, $project_path) { $project = Project::findByPath($owner_path, $project_path); return View::make('projects.edit')->withPageTitle(trans('dashboard.projects.edit.title') . ' - ' . trans('dashboard.dashboard'))->withProject($project)->withGroupId('')->withActiveItem('project_edit')->withGroups(Group::all()); }