Преглед изворни кода

Ultimas ediciones de Jose en junio

Jose Quinones пре 4 година
родитељ
комит
6c052b0be0
3 измењених фајлова са 10 додато и 2 уклоњено
  1. 2
    1
      app/controllers/ActivitiesController.php
  2. 7
    0
      app/models/Outcome.php
  3. 1
    1
      bootstrap/start.php

+ 2
- 1
app/controllers/ActivitiesController.php Прегледај датотеку

@@ -135,7 +135,8 @@ class ActivitiesController extends \BaseController {
135 135
         }
136 136
             // Added the function htmlspecialchars to activity name string because it was corrupting Jquery code while using quotes on page rendering. - Carlos R Caraballo 1/18/2019
137 137
         $title = $course->code.$course->number.'-'.$course->section.': '.htmlspecialchars($activity->name, ENT_QUOTES).' <span class="small attention">('.$course->semester->code.')</span>';
138
-        $outcomes = Outcome::orderBy('name', 'asc')->get();
138
+        //$outcomes = Outcome::orderBy('name', 'asc')->get();
139
+        $outcomes = Outcome::active();
139 140
         $outcomes_achieved = json_decode($activity->outcomes_achieved, true);
140 141
         $outcomes_attempted = json_decode($activity->outcomes_attempted, true);
141 142
 

+ 7
- 0
app/models/Outcome.php Прегледај датотеку

@@ -24,4 +24,11 @@ class Outcome extends Eloquent
24 24
 	    return $this->hasMany('Objective');
25 25
 //		return $this->belongsToMany('Objective', 'objective_outcome');
26 26
 	}
27
+
28
+	public static function active()
29
+    {
30
+        //TODO: Check when semester doesnt exist or session is empty
31
+        $selected_semester = Semester::find(Session::get('semesters_ids')[0]);
32
+        return Outcome::withTrashed()->where('deactivation_date', '>=', $selected_semester->start)->orWhere('deactivation_date', null)->orderBy('name', 'ASC')->get();
33
+    }
27 34
 }

+ 1
- 1
bootstrap/start.php Прегледај датотеку

@@ -26,7 +26,7 @@ $app = new Illuminate\Foundation\Application;
26 26
 
27 27
 $env = $app->detectEnvironment(array(
28 28
 
29
-	'local' => array(gethostname(), 'RPV20111.rrp.campus', 'homestead'),
29
+	'local' => array(gethostname(), 'ubuntu', 'RPV20111.rrp.campus', 'homestead'),
30 30
     'production' => array('*.com', '*.edu', '*.org'),
31 31
 
32 32
 ));