Gabriel Santiago Plaza hace 2 años
padre
commit
73c07ed815

+ 5
- 0
app/controllers/CriteriaController.php Ver fichero

@@ -1370,6 +1370,9 @@ class CriteriaController extends \BaseController
1370 1370
 
1371 1371
         $array_to_send['criterion'] = Criterion::find($criterion_id);
1372 1372
 
1373
+        //coger outcomes de program_criterion, solo dominios  que esten conectados a criterion_id,
1374
+        // bajo el programa_id
1375
+
1373 1376
         $outcomes = DB::table('outcomes')
1374 1377
             ->join('criterion_objective_outcome', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
1375 1378
             ->join('program_criterion_objective_outcome', 'program_criterion_objective_outcome.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
@@ -1381,6 +1384,8 @@ class CriteriaController extends \BaseController
1381 1384
 
1382 1385
         foreach ($outcomes as $out) {
1383 1386
 
1387
+            // get objectivos del dominio pareados a este criterio_id bajo program_id
1388
+
1384 1389
             $out->objectives = DB::table("program_criterion_objective_outcome as poco")
1385 1390
                 ->join('criterion_objective_outcome as cobo', 'cobo.id', '=', 'poco.cri_obj_out_id')
1386 1391
                 ->join('objectives', 'objectives.id', '=', 'cobo.objective_id')

+ 1
- 1
app/controllers/Objective2Controller.php Ver fichero

@@ -1317,7 +1317,7 @@ class Objective2Controller extends \BaseController
1317 1317
 			$objective->outcome_ids = DB::table("objective_outcome")
1318 1318
 				->join('objective_program', 'objective_outcome.objective_id', '=', 'objective_program.objective_id')
1319 1319
 				->where('program_id', $program->id)
1320
-				->where('objective_id', $objective->id)
1320
+				->where('objective_outcome.objective_id', $objective->id)
1321 1321
 				->lists('outcome_id');
1322 1322
 		//Log::info($objectives->outcomes);
1323 1323
 		$array_to_send = [

+ 9
- 0
app/routes.php Ver fichero

@@ -779,5 +779,14 @@ Route::group(array('before' => 'auth|has_access'), function () {
779 779
 
780 780
         Route::get('general-studies-overview', 'ProfessorsController@generalStudiesOverview');
781 781
         Route::get('template/{template}', 'TemplatesController@profShow');
782
+
783
+        /////////////////////////////////////////
784
+        //
785
+        // Routes for view. 
786
+        //
787
+        //
788
+        //////////////////////////////////////////
789
+        Route::get('fetchObjectiveOutcome', 'Objective2Controller@viewObjectiveOutcome');
790
+        Route::get('viewObjectiveOutcome', 'Objective2Controller@viewObjectiveOutcome');
782 791
     });
783 792
 });