Browse Source

Ultimas ediciones de Jose en junio

Jose Quinones 4 years ago
parent
commit
6c052b0be0
3 changed files with 10 additions and 2 deletions
  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 View File

135
         }
135
         }
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
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
         $title = $course->code.$course->number.'-'.$course->section.': '.htmlspecialchars($activity->name, ENT_QUOTES).' <span class="small attention">('.$course->semester->code.')</span>';
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
         $outcomes_achieved = json_decode($activity->outcomes_achieved, true);
140
         $outcomes_achieved = json_decode($activity->outcomes_achieved, true);
140
         $outcomes_attempted = json_decode($activity->outcomes_attempted, true);
141
         $outcomes_attempted = json_decode($activity->outcomes_attempted, true);
141
 
142
 

+ 7
- 0
app/models/Outcome.php View File

24
 	    return $this->hasMany('Objective');
24
 	    return $this->hasMany('Objective');
25
 //		return $this->belongsToMany('Objective', 'objective_outcome');
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 View File

26
 
26
 
27
 $env = $app->detectEnvironment(array(
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
     'production' => array('*.com', '*.edu', '*.org'),
30
     'production' => array('*.com', '*.edu', '*.org'),
31
 
31
 
32
 ));
32
 ));