|
@@ -172,7 +172,9 @@ class OutcomesController extends \BaseController {
|
172
|
172
|
return $carry->merge(Activity::where('course_id', '=', $course->id)->get());
|
173
|
173
|
}, new \Illuminate\Database\Eloquent\Collection);
|
174
|
174
|
|
175
|
|
- return View::make('local.managers.admins.new-learning-outcome', compact('title', 'outcome', 'courses', 'activities'));
|
|
175
|
+ $report_link = URL::action('OutcomesController@newReport', ['id' => $outcome->id]);
|
|
176
|
+
|
|
177
|
+ return View::make('local.managers.admins.new-learning-outcome', compact('title', 'outcome', 'courses', 'activities', 'report_link'));
|
176
|
178
|
}
|
177
|
179
|
public function newShowAll()
|
178
|
180
|
{
|
|
@@ -196,7 +198,9 @@ class OutcomesController extends \BaseController {
|
196
|
198
|
return $carry->merge(Activity::where('course_id', '=', $course->id)->get());
|
197
|
199
|
}, new \Illuminate\Database\Eloquent\Collection);
|
198
|
200
|
|
199
|
|
- return View::make('local.managers.admins.new-learning-outcome', compact('title', 'outcome', 'courses', 'activities'));
|
|
201
|
+ $report_link = URL::action('OutcomesController@newReportAll');
|
|
202
|
+
|
|
203
|
+ return View::make('local.managers.admins.new-learning-outcome', compact('title', 'outcome', 'courses', 'activities', 'report_link'));
|
200
|
204
|
}
|
201
|
205
|
|
202
|
206
|
public function newReport($id)
|
|
@@ -207,15 +211,19 @@ class OutcomesController extends \BaseController {
|
207
|
211
|
$programs = $objectives->map(function ($objective) { return $objective->program; })
|
208
|
212
|
->merge($criteria->map(function ($criteria) { return $criteria->program; }))
|
209
|
213
|
->filter(function ($program) { return $program->users->contains(Auth::user()); });
|
210
|
|
- $title = $outcome->name;
|
211
|
|
- $courses = $programs->reduce(function ($carry, $program) {
|
212
|
|
- return $carry->merge($program->courses);
|
213
|
|
- }, new \Illuminate\Database\Eloquent\Collection);
|
214
|
|
- $activities = $programs->reduce(function ($carry, $course) {
|
215
|
|
- return $carry->merge(Activity::where('course_id', '=', $course->id)->get());
|
216
|
|
- }, new \Illuminate\Database\Eloquent\Collection);
|
|
214
|
+ $title = $outcome->name . ' Report';
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+ return View::make('local.managers.admins.new-report', compact('title', 'outcome', 'objectives'));
|
|
218
|
+
|
|
219
|
+ }
|
|
220
|
+
|
|
221
|
+ public function newReportAll()
|
|
222
|
+ {
|
|
223
|
+ $outcomes = Outcome::with('objectives')->get();
|
|
224
|
+ $title = 'All Outcomes Report';
|
217
|
225
|
|
218
|
|
- return View::make('local.managers.admins.new-learning-outcome', compact('title', 'outcome', 'courses', 'activities'));
|
|
226
|
+ return View::make('local.managers.admins.new-report-all', compact('title', 'outcomes'));
|
219
|
227
|
|
220
|
228
|
}
|
221
|
229
|
|