示例#1
0
 public function show(Request $request, $id)
 {
     $issue = Issue::find($id);
     $role = $request->input('role');
     $currentIssue = Issue::find($id);
     return view('_partials.issues.show', compact('currentIssue', 'role'));
 }
示例#2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($project_id, $id)
 {
     $issue = Issue::find($id);
     $issue->delete();
     flash()->success('Issue has been successfully deleted!');
     return redirect()->action('ProjectsController@show', $project_id);
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $issue = Issue::find($id);
     return $issue;
 }
示例#4
0
 /**
  * Update the sprint associated with an issue
  * @todo create a function to get sprint machine names for a given project
  */
 public function sprintchange()
 {
     $result = "There was an error updating the issue's sprint association";
     $issueId = (int) trim(Request::get('issueId'));
     $projectId = (int) trim(Request::get('projectId'));
     $issue = Issue::find($issueId);
     $machineNameOfNewSprint = trim(strip_tags(Request::get('machineNameOfNewSprint')));
     $sprints = Project::find($issue->project_id)->getSprints();
     $sprintMachineNames = [];
     foreach ($sprints as $sprint) {
         array_push($sprintMachineNames, $sprint->machine_name);
     }
     if (in_array($machineNameOfNewSprint, $sprintMachineNames)) {
         $sprintId = (int) Sprint::where('machine_name', '=', $machineNameOfNewSprint)->where('project_id', '=', $projectId)->first()->id;
         DB::update('update issues set sprint_id = ? where id = ?', [$sprintId, $issueId]);
         $result = "Issue's sprint association has been updated successfully.";
     }
     return $result;
 }