Browse Source

Ultimo push

parent
commit
73c07ed815

+ 5
- 0
app/controllers/CriteriaController.php View File

1370
 
1370
 
1371
         $array_to_send['criterion'] = Criterion::find($criterion_id);
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
         $outcomes = DB::table('outcomes')
1376
         $outcomes = DB::table('outcomes')
1374
             ->join('criterion_objective_outcome', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
1377
             ->join('criterion_objective_outcome', 'outcomes.id', '=', 'criterion_objective_outcome.outcome_id')
1375
             ->join('program_criterion_objective_outcome', 'program_criterion_objective_outcome.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
1378
             ->join('program_criterion_objective_outcome', 'program_criterion_objective_outcome.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
1381
 
1384
 
1382
         foreach ($outcomes as $out) {
1385
         foreach ($outcomes as $out) {
1383
 
1386
 
1387
+            // get objectivos del dominio pareados a este criterio_id bajo program_id
1388
+
1384
             $out->objectives = DB::table("program_criterion_objective_outcome as poco")
1389
             $out->objectives = DB::table("program_criterion_objective_outcome as poco")
1385
                 ->join('criterion_objective_outcome as cobo', 'cobo.id', '=', 'poco.cri_obj_out_id')
1390
                 ->join('criterion_objective_outcome as cobo', 'cobo.id', '=', 'poco.cri_obj_out_id')
1386
                 ->join('objectives', 'objectives.id', '=', 'cobo.objective_id')
1391
                 ->join('objectives', 'objectives.id', '=', 'cobo.objective_id')

+ 1
- 1
app/controllers/Objective2Controller.php View File

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

+ 9
- 0
app/routes.php View File

779
 
779
 
780
         Route::get('general-studies-overview', 'ProfessorsController@generalStudiesOverview');
780
         Route::get('general-studies-overview', 'ProfessorsController@generalStudiesOverview');
781
         Route::get('template/{template}', 'TemplatesController@profShow');
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
 });