|
@@ -1229,8 +1229,8 @@ class TransformativeActionsController extends \BaseController
|
1229
|
1229
|
break;
|
1230
|
1230
|
|
1231
|
1231
|
case 2:
|
1232
|
|
- $schools = DB::table('schools')->where('id', Auth::user()->school_id)->first();
|
1233
|
|
- $programs = DB::table('programs')->where('school_id', $schools->id)->get();
|
|
1232
|
+ $schools = DB::table('schools')->where('id', Auth::user()->school_id)->get();
|
|
1233
|
+ $programs = DB::table('programs')->where('school_id', $schools[0]->id)->get();
|
1234
|
1234
|
break;
|
1235
|
1235
|
case 3:
|
1236
|
1236
|
$programs = DB::table('programs')
|
|
@@ -1241,6 +1241,7 @@ class TransformativeActionsController extends \BaseController
|
1241
|
1241
|
$schools = DB::table('schools')->where('id', $programs[0]->school_id)->get();
|
1242
|
1242
|
break;
|
1243
|
1243
|
}
|
|
1244
|
+
|
1244
|
1245
|
return View::make('local.managers.shared.view_formative', compact('title', 'outcomes', 'schools', 'programs', 'semesters'));
|
1245
|
1246
|
}
|
1246
|
1247
|
|
|
@@ -1285,7 +1286,7 @@ class TransformativeActionsController extends \BaseController
|
1285
|
1286
|
|
1286
|
1287
|
|
1287
|
1288
|
//each row has objectives, repeated ta, but distinct activity_criterion_id
|
1288
|
|
- $objective_ta = DB::table('typ_semester_objectives')
|
|
1289
|
+ /* $objective_ta = DB::table('typ_semester_objectives')
|
1289
|
1290
|
->join('transformative_objective as trob', 'trob.objective_id', '=', 'typ_semester_objectives.objective_id')
|
1290
|
1291
|
->join('objectives', 'trob.objective_id', '=', 'objective_id')
|
1291
|
1292
|
->join('transformative_actions', 'transformative_actions.id', 'trob.ta_id')
|
|
@@ -1295,7 +1296,7 @@ class TransformativeActionsController extends \BaseController
|
1295
|
1296
|
->distinct()
|
1296
|
1297
|
->get();
|
1297
|
1298
|
|
1298
|
|
- $objective_ta = DB::table('typ_semester_objectives')
|
|
1299
|
+ $objective_ta = DB::table('typ_semester_objectives')
|
1299
|
1300
|
->join('transformative_objective as trob', 'trob.objective_id', '=', 'typ_semester_objectives.objective_id')
|
1300
|
1301
|
->join('objectives', 'trob.objective_id', '=', 'objective_id')
|
1301
|
1302
|
->join('transformative_actions', 'transformative_actions.id', 'trob.ta_id')
|
|
@@ -1303,7 +1304,7 @@ class TransformativeActionsController extends \BaseController
|
1303
|
1304
|
->select('transformative_actions.*')
|
1304
|
1305
|
->addSelect('objectives.*')
|
1305
|
1306
|
->distinct()
|
1306
|
|
- ->lists();
|
|
1307
|
+ ->lists();*/
|
1307
|
1308
|
|
1308
|
1309
|
|
1309
|
1310
|
|
|
@@ -1315,6 +1316,8 @@ class TransformativeActionsController extends \BaseController
|
1315
|
1316
|
->whereIn('program_id', $programs)
|
1316
|
1317
|
->whereIn('semester_id', $semesters)
|
1317
|
1318
|
->join('activities', 'activities.course_id', '=', 'courses.id')
|
|
1319
|
+ ->join('activity_criterion', 'activities.id', '=', 'activity_criterion.activity_id')
|
|
1320
|
+ ->join('transformative_activity_criterion as tac', 'tac.activity_criterion_id', '=', 'activity_criterion.id')
|
1318
|
1321
|
->select('courses.*')
|
1319
|
1322
|
->groupBy(array('courses.code', 'courses.name', 'courses.semester_id'))
|
1320
|
1323
|
->get();
|
|
@@ -1328,7 +1331,7 @@ class TransformativeActionsController extends \BaseController
|
1328
|
1331
|
$course_name->sections = DB::table('courses')
|
1329
|
1332
|
->where('code', $course_name->code)
|
1330
|
1333
|
->where('name', $course_name->name)
|
1331
|
|
- ->where('semester_id', $course_name->semester)
|
|
1334
|
+ ->where('semester_id', $course_name->semester_id)
|
1332
|
1335
|
->where('program_id', $course_name->program_id)
|
1333
|
1336
|
->get();
|
1334
|
1337
|
foreach ($course_name->sections as $section) {
|
|
@@ -1339,20 +1342,38 @@ class TransformativeActionsController extends \BaseController
|
1339
|
1342
|
->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'activity_criterion.criterion_id')
|
1340
|
1343
|
->join('transformative_actions', 'transformative_activity_criterion.trans_action_id', '=', 'transformative_actions.id')
|
1341
|
1344
|
->where('activities.course_id', $section->id)
|
|
1345
|
+ ->where('activities.draft', 0)
|
1342
|
1346
|
->where('criterion_objective_outcome.outcome_id', $outcome_id)
|
1343
|
1347
|
->select('activities.id as activity_id', 'activities.name')
|
1344
|
1348
|
->addSelect('transformative_actions.*', 'transformative_activity_criterion.trans_action_id as trans_action_id')
|
1345
|
|
- ->groupBy('transformative_actions.id_')
|
|
1349
|
+ ->groupBy('transformative_actions.id')
|
1346
|
1350
|
->get();
|
1347
|
1351
|
foreach ($section->activities as $activity) {
|
|
1352
|
+ /*$activity->criterion = DB::table('transformative_activity_criterion')
|
|
1353
|
+ ->join('activity_criterion','activity_criterion.id','=','transformative_activity_criterion.activity_criterion_id')
|
|
1354
|
+ ->join('activities','activities.id','=','activity_criterion.activity_id')
|
|
1355
|
+ ->join('criteria','activity_criterion.criterion_id','=','criteria.id')
|
|
1356
|
+ ->where('activity_id', $activity->id)
|
|
1357
|
+ ->select('criteria')*/
|
|
1358
|
+ Log::info($activity->trans_action_id);
|
1348
|
1359
|
$activity->objectives = DB::table('transformative_objective')
|
1349
|
1360
|
->join('objectives', 'transformative_objective.objective_id', '=', 'objectives.id')
|
1350
|
1361
|
->where('ta_id', $activity->trans_action_id)
|
1351
|
1362
|
->get();
|
1352
|
1363
|
foreach ($activity->objectives as $objective) {
|
|
1364
|
+ Log::info($activity->activity_id);
|
|
1365
|
+ Log::info($objective->objective_id);
|
|
1366
|
+ Log::info(DB::table('criterion_objective_outcome')
|
|
1367
|
+ ->join('activity_criterion', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
|
|
1368
|
+ ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
|
|
1369
|
+ ->where('activity_criterion.activity_id', $activity->activity_id)
|
|
1370
|
+ ->where('objective_id', $objective->objective_id)
|
|
1371
|
+ ->select('criteria.*')
|
|
1372
|
+ ->distinct()
|
|
1373
|
+ ->toSql());
|
1353
|
1374
|
$objective->criterion = DB::table('criterion_objective_outcome')
|
1354
|
1375
|
->join('activity_criterion', 'activity_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
|
1355
|
|
- ->join('criteria', 'criteria.id', '=', 'activity_criterion.criteria_id')
|
|
1376
|
+ ->join('criteria', 'criteria.id', '=', 'activity_criterion.criterion_id')
|
1356
|
1377
|
->where('activity_criterion.activity_id', $activity->activity_id)
|
1357
|
1378
|
->where('objective_id', $objective->objective_id)
|
1358
|
1379
|
->select('criteria.*')
|
|
@@ -1362,6 +1383,6 @@ class TransformativeActionsController extends \BaseController
|
1362
|
1383
|
}
|
1363
|
1384
|
}
|
1364
|
1385
|
}
|
1365
|
|
- Log::info($grouped_courses);
|
|
1386
|
+ return $grouped_courses;
|
1366
|
1387
|
}
|
1367
|
1388
|
}
|