Browse Source

Merge branch 'Merge_gabriel_mayo' of https://git.ccom.uprrp.edu/CDCC/OLAS into Merge_gabriel_mayo

eduardo-santin 3 years ago
parent
commit
c4d0c935e9

+ 3
- 3
app/controllers/AnnualPlansController.php View File

210
     $typ_info['transformative_actions'] = DB::select("select * from transformative_actions where by_professor =0 and is_custom=0");
210
     $typ_info['transformative_actions'] = DB::select("select * from transformative_actions where by_professor =0 and is_custom=0");
211
     foreach ($typ_info['objectives'] as $objective) {
211
     foreach ($typ_info['objectives'] as $objective) {
212
 
212
 
213
-      $typ_info['courses'][$objective->id] = DB::select("select c.id, c.number, c.code, typ.id typ_course_id from courses c, typ_semester_courses typ, (select course_id, id  from typ_semester_courses where typ_semester_objective_id in (select id from typ_semester_objectives where objective_id ={$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in(select id from typ_program where program_id ={$program_id})))) rel where typ.course_id =c.id and rel.course_id = c.id and typ.id = rel.id ", array(Input::get('id')));
213
+      $typ_info['courses'][$objective->id] = DB::select("select c.id, c.number, c.name, c.code, typ.id typ_course_id from courses c, typ_semester_courses typ, (select course_id, id  from typ_semester_courses where typ_semester_objective_id in (select id from typ_semester_objectives where objective_id ={$objective->id} and typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id =? and semester_id ={$semester->id} and typ_program_id in(select id from typ_program where program_id ={$program_id})))) rel where typ.course_id =c.id and rel.course_id = c.id and typ.id = rel.id ", array(Input::get('id')));
214
 
214
 
215
       $typ_info['criteria'][$objective->id] = DB::select("select * from criteria where deleted_at IS NULL and id in (select criterion_id from criterion_objective_outcome where outcome_id = ? and objective_id = {$objective->id})", array(Input::get('id')));
215
       $typ_info['criteria'][$objective->id] = DB::select("select * from criteria where deleted_at IS NULL and id in (select criterion_id from criterion_objective_outcome where outcome_id = ? and objective_id = {$objective->id})", array(Input::get('id')));
216
       Log::info($typ_info['criteria'][$objective->id]);
216
       Log::info($typ_info['criteria'][$objective->id]);
344
       Log::info($annual_plan['first']['objectives'][$outcomes->id]);
344
       Log::info($annual_plan['first']['objectives'][$outcomes->id]);
345
       foreach ($annual_plan['first']['objectives'][$outcomes->id] as $objective) {
345
       foreach ($annual_plan['first']['objectives'][$outcomes->id] as $objective) {
346
         $annual_plan['first']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
346
         $annual_plan['first']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
347
-        $annual_plan['first']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['first']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
347
+        $annual_plan['first']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number, c.name from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['first']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
348
         foreach ($annual_plan['first']['courses'][$objective->id] as $course) {
348
         foreach ($annual_plan['first']['courses'][$objective->id] as $course) {
349
           $annual_plan['first']['criteria'][$objective->id][$course->typ_course_id] = DB::select("select * from criteria where  id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id = {$course->typ_course_id} )");
349
           $annual_plan['first']['criteria'][$objective->id][$course->typ_course_id] = DB::select("select * from criteria where  id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id = {$course->typ_course_id} )");
350
           $annual_plan['first']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
350
           $annual_plan['first']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
369
       foreach ($annual_plan['second']['objectives'][$outcomes->id] as $objective) {
369
       foreach ($annual_plan['second']['objectives'][$outcomes->id] as $objective) {
370
         $annual_plan['second']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_end} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
370
         $annual_plan['second']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_end} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
371
 
371
 
372
-        $annual_plan['second']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['second']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
372
+        $annual_plan['second']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number, c.name from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['second']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
373
         foreach ($annual_plan['second']['courses'][$objective->id] as $course) {
373
         foreach ($annual_plan['second']['courses'][$objective->id] as $course) {
374
           $annual_plan['second']['criteria'][$objective->id][$course->course_id] = DB::select("select * from criteria where id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id ={$course->typ_course_id})");
374
           $annual_plan['second']['criteria'][$objective->id][$course->course_id] = DB::select("select * from criteria where id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id ={$course->typ_course_id})");
375
           $annual_plan['second']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
375
           $annual_plan['second']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");

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

327
 		$userSchool = Auth::user()['school_id'];
327
 		$userSchool = Auth::user()['school_id'];
328
 		Log::info($userSchool);
328
 		Log::info($userSchool);
329
 		$title = "Objective";
329
 		$title = "Objective";
330
-		$outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->lists('name', 'id');
330
+		$outcomes = Outcome::whereNull("deactivation_date")->orderBy('name', 'ASC')->get();
331
 
331
 
332
 		$objectives = Objective::withTrashed()->orderBy('text', 'ASC')->get();
332
 		$objectives = Objective::withTrashed()->orderBy('text', 'ASC')->get();
333
 		$programs = Program::where("school_id", "=", $userSchool)->orderBy('name', 'ASC')->get();
333
 		$programs = Program::where("school_id", "=", $userSchool)->orderBy('name', 'ASC')->get();

+ 176
- 128
app/controllers/TransformativeActionsController.php View File

18
     $programs = Program::orderBy('name', 'ASC')->get();
18
     $programs = Program::orderBy('name', 'ASC')->get();
19
     $user_id = auth::user()->id;
19
     $user_id = auth::user()->id;
20
 
20
 
21
-    $program_id = DB::table('program_user')
21
+    switch ($role) {
22
+      case 3:
23
+        $program_id = DB::table('program_user')
24
+          ->where('user_id', $user_id)
25
+          ->select('program_id')
26
+          ->lists('program_id');
27
+
28
+        break;
29
+
30
+      case 2:
31
+        $program_id = DB::table('programs')
32
+          ->where('school_id', Auth::user()->school_id)
33
+          ->lists('id');
34
+        break;
35
+    }
36
+    /*$program_id = DB::table('program_user')
22
       ->where('user_id', $user_id)
37
       ->where('user_id', $user_id)
23
       ->select('program_id')
38
       ->select('program_id')
24
       ->get();
39
       ->get();
25
-    $program_id = $program_id[0]->program_id; //program id 15 debido al user 8
40
+    $program_id = $program_id[0]->program_id; */ //program id 15 debido al user 8
26
     $outcomes = Outcome::orderBy('name', 'ASC')
41
     $outcomes = Outcome::orderBy('name', 'ASC')
27
       ->where('deactivation_date', '=', '0000-00-00')
42
       ->where('deactivation_date', '=', '0000-00-00')
28
       ->orWhereNull('deactivation_date')
43
       ->orWhereNull('deactivation_date')
34
       ->distinct()
49
       ->distinct()
35
       ->get();
50
       ->get();
36
     // if user is program coordinator
51
     // if user is program coordinator
37
-    if ($role == 3) {
38
-      //1 edit panel: load the TA that
39
-      //    are custom ('transformative_actions.by_professor' == 0)
40
-      //    were approved in past ('transformative_actions.is_custom' == 1)
41
-      $ta_edit_panel = DB::table('transformative_actions')
42
-        ->where('transformative_actions.is_custom', 1)
43
-        ->where('transformative_actions.program_id', $program_id)
44
-        ->where('transformative_actions.by_professor', 0)
45
-        ->orderBy('at_text', 'ASC')
46
-        ->get();
47
-      //2 approve panel: load TAs that
48
-      //    can be approved ('transformative_actions.by_professor' == 1)
49
-      $ta_approval_panel = DB::table('transformative_actions')
50
-        ->where('transformative_actions.is_custom', 1)
51
-        ->where('transformative_actions.program_id', $program_id)
52
-        ->where('transformative_actions.by_professor', 1)
53
-        ->orderBy('at_text', 'ASC')
54
-        ->get();
55
-      //2.1 approve panel: load the filter options.
56
-      // the "->where()" should be the same from $ta_approval_panel,
57
-      //  but with aditional joins and different select
58
-      //
59
-      // get the names of the professors
60
-      $professor_filter_approvePanel = DB::table('transformative_actions')
61
-        ->join('users', 'users.id', '=', 'transformative_actions.user_id')
62
-        ->where('transformative_actions.is_custom', 1)
63
-        ->where('transformative_actions.program_id', $program_id)
64
-        ->where('transformative_actions.by_professor', 1)
65
-        ->select('users.*')
66
-        ->groupby('transformative_actions.user_id')
67
-        ->orderBy('users.first_name', 'ASC')
68
-        ->get();
69
-      // get the courses from asociated with a TA
70
-      $course_filter_approvePanel = DB::table('ta_course')
71
-        ->join('transformative_actions', 'transformative_actions.id', '=', 'ta_course.ta_id')
72
-        ->join('courses', function ($join) {
73
-          $join->on('courses.number', '=', 'ta_course.course_number');
74
-          $join->on('courses.code', '=', 'ta_course.course_code');
75
-        })
76
-        ->where('transformative_actions.is_custom', 1)
77
-        ->where('transformative_actions.program_id', $program_id)
78
-        ->where('transformative_actions.by_professor', 1)
79
-        ->select('courses.*')
80
-        ->groupBy('courses.number', 'courses.code')
81
-        ->orderBy('courses.name', 'ASC')
82
-        ->orderBy('courses.code', 'ASC')
83
-        ->get();
84
-      // get the outcome asociated with a TA
85
-      $outcome_filter_approvePanel = DB::table('transformative_actions')
86
-        ->join('transformative_objective', 'transformative_objective.ta_id', '=', 'transformative_actions.id')
87
-        ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'transformative_objective.objective_id')
88
-        ->join('outcomes', 'outcomes.id', '=', 'objective_outcome.outcome_id')
89
-        ->where('transformative_actions.is_custom', 1)
90
-        ->where('transformative_actions.program_id', $program_id)
91
-        ->where('transformative_actions.by_professor', 1)
92
-        ->select('outcomes.*')
93
-        ->groupBy('outcomes.id')
94
-        ->orderBy('outcomes.name', 'ASC')
95
-        ->get();
96
-      //3 edit panel: load the filter options.
97
-      // the "->where()" should be the same from $ta_edit_panel,
98
-      //  but with aditional joins and different select
99
-      //
100
-      $professor_filter_editPanel = DB::table('transformative_actions')
101
-        ->join('users', 'users.id', '=', 'transformative_actions.user_id')
102
-        ->where('transformative_actions.is_custom', 1)
103
-        ->where('transformative_actions.program_id', $program_id)
104
-        ->where('transformative_actions.by_professor', 0)
105
-        ->select('users.*')
106
-        ->groupby('transformative_actions.user_id')
107
-        ->orderBy('users.first_name', 'ASC')
108
-        ->get();
109
-      $course_filter_editPanel =  DB::table('ta_course')
110
-        ->join('transformative_actions', 'transformative_actions.id', '=', 'ta_course.ta_id')
111
-        ->join('courses', function ($join) {
112
-          $join->on('courses.number', '=', 'ta_course.course_number');
113
-          $join->on('courses.code', '=', 'ta_course.course_code');
114
-        })
115
-        ->where('transformative_actions.is_custom', 1)
116
-        ->where('transformative_actions.program_id', $program_id)
117
-        ->where('transformative_actions.by_professor', 0)
118
-        ->select('courses.*')
119
-        ->groupBy('courses.number', 'courses.code')
120
-        ->orderBy('courses.name', 'ASC')
121
-        ->orderBy('courses.code', 'ASC')
122
-        ->get();
123
-      $outcome_filter_editPanel = DB::table('transformative_actions')
124
-        ->join('transformative_objective', 'transformative_objective.ta_id', '=', 'transformative_actions.id')
125
-        ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'transformative_objective.objective_id')
126
-        ->join('outcomes', 'outcomes.id', '=', 'objective_outcome.outcome_id')
127
-        ->where('transformative_actions.is_custom', 1)
128
-        ->where('transformative_actions.program_id', $program_id)
129
-        ->where('transformative_actions.by_professor', 0)
130
-        ->select('outcomes.*')
131
-        ->groupBy('outcomes.id')
132
-        ->orderBy('outcomes.name', 'ASC')
133
-        ->get();
134
-      // 4 create panel: search all courses
135
-      $courses_create = DB::table('courses')
136
-        ->where('courses.program_id', $program_id)
137
-        ->select('courses.*')
138
-        ->groupBy('courses.number', 'courses.code')
139
-        ->orderBy('courses.name', 'ASC')
140
-        ->orderBy('courses.code', 'ASC')
141
-        ->get();
142
-    }/*
52
+
53
+    //1 edit panel: load the TA that
54
+    //    are custom ('transformative_actions.by_professor' == 0)
55
+    //    were approved in past ('transformative_actions.is_custom' == 1)
56
+    $ta_edit_panel = DB::table('transformative_actions')
57
+      ->where('transformative_actions.is_custom', 1)
58
+      ->whereIn('transformative_actions.program_id', $program_id)
59
+      ->where('transformative_actions.by_professor', 0)
60
+      ->orderBy('at_text', 'ASC')
61
+      ->get();
62
+    //2 approve panel: load TAs that
63
+    //    can be approved ('transformative_actions.by_professor' == 1)
64
+    $ta_approval_panel = DB::table('transformative_actions')
65
+      ->where('transformative_actions.is_custom', 1)
66
+      ->whereIn('transformative_actions.program_id', $program_id)
67
+      ->where('transformative_actions.by_professor', 1)
68
+      ->orderBy('at_text', 'ASC')
69
+      ->get();
70
+    //2.1 approve panel: load the filter options.
71
+    // the "->where()" should be the same from $ta_approval_panel,
72
+    //  but with aditional joins and different select
73
+    //
74
+    // get the names of the professors
75
+    $professor_filter_approvePanel = DB::table('transformative_actions')
76
+      ->join('users', 'users.id', '=', 'transformative_actions.user_id')
77
+      ->where('transformative_actions.is_custom', 1)
78
+      ->whereIn('transformative_actions.program_id', $program_id)
79
+      ->where('transformative_actions.by_professor', 1)
80
+      ->select('users.*')
81
+      ->groupBy('transformative_actions.user_id')
82
+      ->orderBy('users.first_name', 'ASC')
83
+      ->get();
84
+    // get the courses from asociated with a TA
85
+    $course_filter_approvePanel = DB::table('ta_course')
86
+      ->join('transformative_actions', 'transformative_actions.id', '=', 'ta_course.ta_id')
87
+      ->join('courses', function ($join) {
88
+        $join->on('courses.number', '=', 'ta_course.course_number');
89
+        $join->on('courses.code', '=', 'ta_course.course_code');
90
+      })
91
+      ->where('transformative_actions.is_custom', 1)
92
+      ->whereIn('transformative_actions.program_id', $program_id)
93
+      ->where('transformative_actions.by_professor', 1)
94
+      ->select('courses.*')
95
+      ->groupBy('courses.number', 'courses.code', 'courses.name')
96
+      ->orderBy('courses.name', 'ASC')
97
+      ->orderBy('courses.code', 'ASC')
98
+      ->get();
99
+    // get the outcome asociated with a TA
100
+    $outcome_filter_approvePanel = DB::table('transformative_actions')
101
+      ->join('transformative_objective', 'transformative_objective.ta_id', '=', 'transformative_actions.id')
102
+      ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'transformative_objective.objective_id')
103
+      ->join('outcomes', 'outcomes.id', '=', 'objective_outcome.outcome_id')
104
+      ->where('transformative_actions.is_custom', 1)
105
+      ->whereIn('transformative_actions.program_id', $program_id)
106
+      ->where('transformative_actions.by_professor', 1)
107
+      ->select('outcomes.*')
108
+      ->groupBy('outcomes.id')
109
+      ->orderBy('outcomes.name', 'ASC')
110
+      ->get();
111
+    //3 edit panel: load the filter options.
112
+    // the "->where()" should be the same from $ta_edit_panel,
113
+    //  but with aditional joins and different select
114
+    //
115
+    $professor_filter_editPanel = DB::table('transformative_actions')
116
+      ->join('users', 'users.id', '=', 'transformative_actions.user_id')
117
+      ->where('transformative_actions.is_custom', 1)
118
+      ->whereIn('transformative_actions.program_id', $program_id)
119
+      ->where('transformative_actions.by_professor', 0)
120
+      ->select('users.*')
121
+      ->groupBy('transformative_actions.user_id')
122
+      ->orderBy('users.first_name', 'ASC')
123
+      ->get();
124
+    $course_filter_editPanel =  DB::table('ta_course')
125
+      ->join('transformative_actions', 'transformative_actions.id', '=', 'ta_course.ta_id')
126
+      ->join('courses', function ($join) {
127
+        $join->on('courses.number', '=', 'ta_course.course_number');
128
+        $join->on('courses.code', '=', 'ta_course.course_code');
129
+      })
130
+      ->where('transformative_actions.is_custom', 1)
131
+      ->whereIn('transformative_actions.program_id', $program_id)
132
+      ->where('transformative_actions.by_professor', 0)
133
+      ->select('courses.*')
134
+      ->groupBy('courses.number', 'courses.code', 'courses.name')
135
+      ->orderBy('courses.name', 'ASC')
136
+      ->orderBy('courses.code', 'ASC')
137
+      ->get();
138
+    $outcome_filter_editPanel = DB::table('transformative_actions')
139
+      ->join('transformative_objective', 'transformative_objective.ta_id', '=', 'transformative_actions.id')
140
+      ->join('objective_outcome', 'objective_outcome.objective_id', '=', 'transformative_objective.objective_id')
141
+      ->join('outcomes', 'outcomes.id', '=', 'objective_outcome.outcome_id')
142
+      ->where('transformative_actions.is_custom', 1)
143
+      ->whereIn('transformative_actions.program_id', $program_id)
144
+      ->where('transformative_actions.by_professor', 0)
145
+      ->select('outcomes.*')
146
+      ->groupBy('outcomes.id')
147
+      ->orderBy('outcomes.name', 'ASC')
148
+      ->get();
149
+    // 4 create panel: search all courses
150
+    $courses_create = DB::table('courses')
151
+      ->whereIn('courses.program_id', $program_id)
152
+      ->select('courses.*')
153
+      ->groupBy('courses.number', 'courses.code',  'courses.name')
154
+      ->orderBy('courses.name', 'ASC')
155
+      ->orderBy('courses.code', 'ASC')
156
+      ->get();
157
+    /*
143
     // if user is profesor
158
     // if user is profesor
144
     elseif ($role == 4) {
159
     elseif ($role == 4) {
145
       // 1 the user can only edit TA that need approval and has been submited by the same user
160
       // 1 the user can only edit TA that need approval and has been submited by the same user
319
     } else {
334
     } else {
320
 
335
 
321
       $user_id = Auth::user()->id;
336
       $user_id = Auth::user()->id;
322
-      $program_id = DB::table('program_user')
337
+
338
+
339
+      /*$program_id = DB::table('program_user')
323
         ->where('user_id', $user_id)
340
         ->where('user_id', $user_id)
324
         ->select('program_id')
341
         ->select('program_id')
325
         ->get();
342
         ->get();
326
-      $program_id = $program_id[0]->program_id;
343
+      $program_id = $program_id[0]->program_id;*/
327
       $role = Auth::user()['role'];
344
       $role = Auth::user()['role'];
328
       $by_professor = 1;
345
       $by_professor = 1;
329
-      if ($role == 3) {
346
+      if ($role != 4) {
330
         $by_professor = 0;
347
         $by_professor = 0;
331
       }
348
       }
332
       Log::info($clean_input['courseid']);
349
       Log::info($clean_input['courseid']);
337
 
354
 
338
       $course_code_number = explode(',', $course_code_number);
355
       $course_code_number = explode(',', $course_code_number);
339
 
356
 
357
+      $program_id = DB::table('courses')
358
+        ->where('code', $course_code_number[0])
359
+        ->where('number', $course_code_number[1])
360
+        ->select('program_id')
361
+        ->first()->program_id;
362
+
363
+
340
       $current_timestamp = date('Y/m/d H:i:s', time());
364
       $current_timestamp = date('Y/m/d H:i:s', time());
341
       if ($clean_input['new_type']) $type = $clean_input['new_type'];
365
       if ($clean_input['new_type']) $type = $clean_input['new_type'];
342
       else $type = $clean_input['type'];
366
       else $type = $clean_input['type'];
459
       $role = Auth::user()['role'];
483
       $role = Auth::user()['role'];
460
       return Redirect::to('transformativeAction')->withInput();
484
       return Redirect::to('transformativeAction')->withInput();
461
     } else {
485
     } else {
486
+      $parentesis = array('(', ')');
487
+      $course_code_number = str_replace($parentesis, '', $clean_input['courseid']);
488
+
489
+      $course_code_number = explode(',', $course_code_number);
490
+
491
+      $program_id = DB::table('courses')
492
+        ->where('code', $course_code_number[0])
493
+        ->where('number', $course_code_number[1])
494
+        ->select('program_id')
495
+        ->first()->program_id;
462
 
496
 
463
       $user_id = auth::user()->id;
497
       $user_id = auth::user()->id;
464
-      $program_id = DB::table('program_user')
498
+      /* $program_id = DB::table('program_user')
465
         ->where('user_id', $user_id)
499
         ->where('user_id', $user_id)
466
         ->select('program_id')
500
         ->select('program_id')
467
         ->get();
501
         ->get();
468
-      $program_id = $program_id[0]->program_id;
502
+      $program_id = $program_id[0]->program_id;*/
469
       $role = Auth::user()['role'];
503
       $role = Auth::user()['role'];
470
       $by_professor = $clean_input['approval'];
504
       $by_professor = $clean_input['approval'];
471
       if ($role == 4) {
505
       if ($role == 4) {
532
         }
566
         }
533
       }
567
       }
534
 
568
 
535
-      $parentesis = array('(', ')');
536
-      $course_code_number = str_replace($parentesis, '', $clean_input['courseid']);
537
 
569
 
538
-      $course_code_number = explode(',', $course_code_number);
570
+
571
+
539
 
572
 
540
       DB::update(
573
       DB::update(
541
         "UPDATE `ta_course` set `course_number` = '{$course_code_number[1]}', `course_code` = '{$course_code_number[0]}' where ta_id = {$ta_id}"
574
         "UPDATE `ta_course` set `course_number` = '{$course_code_number[1]}', `course_code` = '{$course_code_number[0]}' where ta_id = {$ta_id}"
739
       ->lists('status');
772
       ->lists('status');
740
     $status = $status[0];
773
     $status = $status[0];
741
     $plans_count = DB::table('annual_plan_transformative')
774
     $plans_count = DB::table('annual_plan_transformative')
742
-      ->where('id', $ta_id)
775
+      ->where('trans_id', $ta_id)
743
       ->get();
776
       ->get();
744
     $plans_count = count($plans_count);
777
     $plans_count = count($plans_count);
745
     $can_be_deleted = false;
778
     $can_be_deleted = false;
746
-    if ($plans_count == 0 && $status == 1) {
779
+    if ($plans_count == 0 /*&& $status == 1*/) {
747
       $can_be_deleted = true;
780
       $can_be_deleted = true;
748
     }
781
     }
749
     return array(
782
     return array(
800
       ->whereIn('objective_program.program_id', $program_ids)
833
       ->whereIn('objective_program.program_id', $program_ids)
801
       ->orderBy('objectives.text', 'ASC')
834
       ->orderBy('objectives.text', 'ASC')
802
       ->select('objectives.text as text', 'objectives.id as id')
835
       ->select('objectives.text as text', 'objectives.id as id')
836
+      ->distinct()
803
       ->get();
837
       ->get();
804
 
838
 
805
     return array(
839
     return array(
816
     $course_id = Input::get('course_id');
850
     $course_id = Input::get('course_id');
817
     $outcome_id = Input::get('outcome_id');
851
     $outcome_id = Input::get('outcome_id');
818
     $panel_id = Input::get('panel_id');
852
     $panel_id = Input::get('panel_id');
819
-    $program_id = DB::table('program_user')
820
-      ->where('user_id', $user_id)
821
-      ->select('program_id')
822
-      ->get();
823
-    $program_id = $program_id[0]->program_id;
853
+
854
+    switch ($role) {
855
+      case 1:
856
+        $program_id = DB::table('programs')->lists('id');
857
+        break;
858
+
859
+      case 2:
860
+        $program_id = DB::table('programs')->where('school_id', Auth::user()->school_id)
861
+          ->lists('id');
862
+        break;
863
+      case 3:
864
+        $program_id = DB::table('program_user')
865
+          ->where('user_id', $user_id)
866
+          ->select('program_id')
867
+          ->get();
868
+        $program_id = $program_id[0]->program_id;
869
+        break;
870
+    }
871
+
824
 
872
 
825
     // if the user is a coordinator filtering the approvePanel
873
     // if the user is a coordinator filtering the approvePanel
826
-    if ($role == '3' && $panel_id == 'approvePanel') {
874
+    /*if ($role == '3' && $panel_id == 'approvePanel') {
827
 
875
 
828
       // if professor isnt a desired filter, search all professors
876
       // if professor isnt a desired filter, search all professors
829
       if ($professor_id == 0) {
877
       if ($professor_id == 0) {
909
         ->orderBy('transformative_actions.at_text', 'ASC')
957
         ->orderBy('transformative_actions.at_text', 'ASC')
910
         ->get();
958
         ->get();
911
       return $filtered_at;
959
       return $filtered_at;
912
-    }
960
+    }*/
913
     // if the user is a coordinator filtering the editPanel
961
     // if the user is a coordinator filtering the editPanel
914
-    elseif ($role == '3' && $panel_id == 'editPanel') {
962
+    if ($panel_id == 'editPanel') {
915
 
963
 
916
       // if professor isnt a desired filter, search all professors
964
       // if professor isnt a desired filter, search all professors
917
       if ($professor_id == 0) {
965
       if ($professor_id == 0) {
998
       return $filtered_at;
1046
       return $filtered_at;
999
     }
1047
     }
1000
     // if the user is a professor filtering the editPanel
1048
     // if the user is a professor filtering the editPanel
1001
-    elseif ($role == '4' && $panel_id == 'editPanel') {
1049
+    /*elseif ($role == '4' && $panel_id == 'editPanel') {
1002
 
1050
 
1003
       // if course isnt a desired filter, search all courses
1051
       // if course isnt a desired filter, search all courses
1004
       if ($course_id == 0) {
1052
       if ($course_id == 0) {
1067
         ->orderBy('transformative_actions.at_text', 'ASC')
1115
         ->orderBy('transformative_actions.at_text', 'ASC')
1068
         ->get();
1116
         ->get();
1069
       return $filtered_at;
1117
       return $filtered_at;
1070
-    }
1118
+    }*/
1071
     return 'ilegal';
1119
     return 'ilegal';
1072
   }
1120
   }
1073
 
1121
 

+ 43
- 42
app/views/local/managers/admins/transformativeAction.blade.php View File

45
                 <div class="form-group col-md-11">
45
                 <div class="form-group col-md-11">
46
                   <select name="courseid" class="form-control createCourses selectpicker">
46
                   <select name="courseid" class="form-control createCourses selectpicker">
47
                     @foreach ($courses_create as $course)
47
                     @foreach ($courses_create as $course)
48
-                      <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->number}}</option>
48
+                      <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->name}}</option>
49
                     @endforeach
49
                     @endforeach
50
                   </select>
50
                   </select>
51
                 </div>
51
                 </div>
104
               {{ Form::close() }}
104
               {{ Form::close() }}
105
             </div>
105
             </div>
106
         </div>
106
         </div>
107
-        <div class="panel panel-default panel-button">
107
+
108
+        <!--<div class="panel panel-default panel-button">
108
             <div class="panel-heading">
109
             <div class="panel-heading">
109
                 Approve a Recommended TA
110
                 Approve a Recommended TA
110
             </div>
111
             </div>
124
                     <label>Professor that created the TA</label>
125
                     <label>Professor that created the TA</label>
125
                     <select class="form-control filterProfessor selectpicker">
126
                     <select class="form-control filterProfessor selectpicker">
126
                       <option value="0">Show All</option>
127
                       <option value="0">Show All</option>
127
-                      @foreach ($professor_filter_approvePanel as $ta)
128
+                     {{-- @foreach ($professor_filter_approvePanel as $ta)
128
                         <option value="{{$ta->id}}">Prof. {{$ta->first_name}} {{$ta->surnames}}</option>
129
                         <option value="{{$ta->id}}">Prof. {{$ta->first_name}} {{$ta->surnames}}</option>
129
-                      @endforeach
130
+                      @endforeach--}}
130
                     </select>
131
                     </select>
131
                   </div>
132
                   </div>
132
                   <br>
133
                   <br>
134
                     <label>Course evaluated by an Objective of the TA</label>
135
                     <label>Course evaluated by an Objective of the TA</label>
135
                     <select class="form-control filterCourse selectpicker">
136
                     <select class="form-control filterCourse selectpicker">
136
                       <option value="0">Show All</option>
137
                       <option value="0">Show All</option>
137
-                      @foreach ($course_filter_approvePanel as $course)
138
+                      {{--@foreach ($course_filter_approvePanel as $course)
138
                         <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->number}}</option>
139
                         <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->number}}</option>
139
-                      @endforeach
140
+                      @endforeach--}}
140
                     </select>
141
                     </select>
141
                   </div>
142
                   </div>
142
                   <br>
143
                   <br>
144
                     <label>Outcome of the TA</label>
145
                     <label>Outcome of the TA</label>
145
                     <select class="form-control filterOutcome selectpicker">
146
                     <select class="form-control filterOutcome selectpicker">
146
                       <option value="0">Show All</option>
147
                       <option value="0">Show All</option>
147
-                      @foreach ($outcome_filter_approvePanel as $outcome)
148
+                      {{--@foreach ($outcome_filter_approvePanel as $outcome)
148
                         <option value="{{$outcome->id}}">{{$outcome->name}}</option>
149
                         <option value="{{$outcome->id}}">{{$outcome->name}}</option>
149
-                      @endforeach
150
+                      @endforeach--}}
150
                     </select>
151
                     </select>
151
                   </div>
152
                   </div>
152
                 </div>
153
                 </div>
153
               </div>
154
               </div>
154
               <hr>
155
               <hr>
155
-              {{ Form::open(array('action' => 'TransformativeActionsController@approveTA')) }}
156
+              {{-- Form::open(array('action' => 'TransformativeActionsController@approveTA')) --}}
156
 
157
 
157
               <div>
158
               <div>
158
                 <div class="form-group col-md-11">
159
                 <div class="form-group col-md-11">
159
                   <label>Select Transformative Action</label>
160
                   <label>Select Transformative Action</label>
160
                   <select name="ta" class="form-control SelectTA selectpicker" id='approvalSelectTA'>
161
                   <select name="ta" class="form-control SelectTA selectpicker" id='approvalSelectTA'>
161
-                    @if (count($ta_approval_panel) == 0)
162
+                   {{-- @if (count($ta_approval_panel) == 0)
162
                       <option value="0">No TAs available</option>
163
                       <option value="0">No TAs available</option>
163
                     @else
164
                     @else
164
                     @endif
165
                     @endif
165
                     @foreach ($ta_approval_panel as $ta)
166
                     @foreach ($ta_approval_panel as $ta)
166
                       <option value="{{$ta->id}}">{{$ta->at_text}}</option>
167
                       <option value="{{$ta->id}}">{{$ta->at_text}}</option>
167
-                   @endforeach
168
+                   @endforeach--}}
168
                   </select>
169
                   </select>
169
                 </div>
170
                 </div>
170
               </div>
171
               </div>
171
 
172
 
172
               <div class="form-group">
173
               <div class="form-group">
173
-                {{ Form::label('approvalDescription', 'Description') }}
174
-                {{ Form::textarea('approvalDescription', '', array('class' => 'form-control')) }}
174
+               {{-- {{ Form::label('approvalDescription', 'Description') }}
175
+                {{ Form::textarea('approvalDescription', '', array('class' => 'form-control')) }}--}}
175
               </div>
176
               </div>
176
 
177
 
177
               <label>Associated Courses</label>
178
               <label>Associated Courses</label>
182
                       
183
                       
183
                   </select>
184
                   </select>
184
                 </div>
185
                 </div>
185
-               <!-- <button type="button" class='btn btn-md btn-primary col-md-1 remove-course'>
186
+                <button type="button" class='btn btn-md btn-primary col-md-1 remove-course'>
186
                   X
187
                   X
187
-                </button>-->
188
+                </button>
188
               </div>
189
               </div>
189
-              <!--<button type="button" class='btn btn-md btn-secondary add-course'>
190
+              <button type="button" class='btn btn-md btn-secondary add-course'>
190
                 <span class='glyphicon glyphicon-plus'>
191
                 <span class='glyphicon glyphicon-plus'>
191
                 </span>
192
                 </span>
192
                 Add another Course
193
                 Add another Course
193
-              </button>-->
194
+              </button>
194
 
195
 
195
               <label>Associated Objectives</label>
196
               <label>Associated Objectives</label>
196
               <div class="approveObjectives">
197
               <div class="approveObjectives">
197
                 <div class="form-group col-md-11">
198
                 <div class="form-group col-md-11">
198
                   <select name="objectiveid[]" class="form-control">
199
                   <select name="objectiveid[]" class="form-control">
199
-                    @foreach ($objectives as $id => $text)
200
+                   {{-- @foreach ($objectives as $id => $text)
200
                       <option value="{{$id}}">{{$text}}</option>
201
                       <option value="{{$id}}">{{$text}}</option>
201
-                    @endforeach
202
+                    @endforeach--}}
202
                   </select>
203
                   </select>
203
                 </div>
204
                 </div>
204
                 <button type="button" class='btn btn-md btn-primary col-md-1 remove-objective'>
205
                 <button type="button" class='btn btn-md btn-primary col-md-1 remove-objective'>
215
                 <label>Type of Transformative Action</label>
216
                 <label>Type of Transformative Action</label>
216
                 <select name='type_of_ta' class="form-control selectpicker">
217
                 <select name='type_of_ta' class="form-control selectpicker">
217
                   <option value ='0'>Select a Type</option>
218
                   <option value ='0'>Select a Type</option>
218
-                  @foreach($types as $type)
219
+                 {{-- @foreach($types as $type)
219
                   <option value = '{{$type->type_of_TA}}'>{{$type->type_of_TA}}</option>
220
                   <option value = '{{$type->type_of_TA}}'>{{$type->type_of_TA}}</option>
220
-                  @endforeach
221
+                  @endforeach--}}
221
                   <option value ="new"> New Type of Transformative Action</option>
222
                   <option value ="new"> New Type of Transformative Action</option>
222
 
223
 
223
                 </select>
224
                 </select>
227
 
228
 
228
               <input type='hidden' name='ta_id' class='updateTA'>
229
               <input type='hidden' name='ta_id' class='updateTA'>
229
 
230
 
230
-              {{ Form::submit('Approve', array('class' => 'btn btn-primary btn-block')) }}
231
-              {{ Form::close() }}
231
+              {{-- Form::submit('Approve', array('class' => 'btn btn-primary btn-block')) }}
232
+              {{ Form::close() --}}
232
             </div>
233
             </div>
233
-        </div>
234
+        </div> -->
234
     </div>
235
     </div>
235
 
236
 
236
     <div class="col-md-6">
237
     <div class="col-md-6">
265
                     <select class="form-control filterCourse selectpicker">
266
                     <select class="form-control filterCourse selectpicker">
266
                       <option value="0">Show All</option>
267
                       <option value="0">Show All</option>
267
                       @foreach ($course_filter_editPanel as $course)
268
                       @foreach ($course_filter_editPanel as $course)
268
-                        <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->number}}</option>
269
+                        <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->name}}</option>
269
                       @endforeach
270
                       @endforeach
270
                     </select>
271
                     </select>
271
                   </div>
272
                   </div>
325
                 <div class="form-group col-md-11 editCourse">
326
                 <div class="form-group col-md-11 editCourse">
326
                   <select name="courseid" id = "edit_course" class="form-control selectpicker">
327
                   <select name="courseid" id = "edit_course" class="form-control selectpicker">
327
                     @foreach ($courses_create as $course)
328
                     @foreach ($courses_create as $course)
328
-                      <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->number}}</option>
329
+                      <option value="({{$course->code}},{{$course->number}})">{{$course->code}} {{$course->name}}</option>
329
                     @endforeach
330
                     @endforeach
330
                   </select>
331
                   </select>
331
                 </div>
332
                 </div>
431
 
432
 
432
 
433
 
433
 var role = {{Auth::user()['role']}};
434
 var role = {{Auth::user()['role']}};
434
-if (role == 3){
435
+if (role != 4){
435
   dummyApproval.find('select').append('<option value="0">To be implemented</option>');
436
   dummyApproval.find('select').append('<option value="0">To be implemented</option>');
436
   $('#approvePanel .add-course').hide();
437
   $('#approvePanel .add-course').hide();
437
-} else if (role == 4){
438
+} /* else if (role == 4){
438
   dummyApproval.find('select').append('<option value="1">Recommended</option>');
439
   dummyApproval.find('select').append('<option value="1">Recommended</option>');
439
   $('#approvePanel').parent().hide();
440
   $('#approvePanel').parent().hide();
440
 
441
 
446
   // in edit panel, hide the professor filter
447
   // in edit panel, hide the professor filter
447
   $('.filterProfessor').parent().hide();
448
   $('.filterProfessor').parent().hide();
448
   $('.filterProfessor').parent().next().hide(); // hide <br>
449
   $('.filterProfessor').parent().next().hide(); // hide <br>
449
-}
450
+}*/
450
 
451
 
451
 $('.createObjectives').prop('disabled', 'disabled');
452
 $('.createObjectives').prop('disabled', 'disabled');
452
 $('#createPanel .add-objective').prop('disabled', 'disabled');
453
 $('#createPanel .add-objective').prop('disabled', 'disabled');
477
   $('#approvalDescription').prop('disabled', 'disabled');
478
   $('#approvalDescription').prop('disabled', 'disabled');
478
 }else{
479
 }else{
479
   var ta_id = $('#approvalSelectTA').val();
480
   var ta_id = $('#approvalSelectTA').val();
480
-  if(ta_id != 0){
481
-    load_ta_info_for_approval(ta_id);
482
-  }
481
+  //if(ta_id != 0){
482
+  //  load_ta_info_for_approval(ta_id);
483
+  //}
483
 
484
 
484
 }
485
 }
485
 
486
 
664
   );
665
   );
665
 }
666
 }
666
 
667
 
667
-function load_ta_info_for_approval(ta_id) {
668
+/*function load_ta_info_for_approval(ta_id) {
668
   $.post(
669
   $.post(
669
     "{{ URL::action('TransformativeActionsController@selectTA') }}",
670
     "{{ URL::action('TransformativeActionsController@selectTA') }}",
670
     {
671
     {
711
       $('.approvalText').val(name);
712
       $('.approvalText').val(name);
712
       $('#approvePanel .updateTA').val(ta_id);
713
       $('#approvePanel .updateTA').val(ta_id);
713
 
714
 
714
-/*
715
+
715
       //locate de "add course" button on approve panel
716
       //locate de "add course" button on approve panel
716
       var add_course_button = $('#approvePanel .add-course')
717
       var add_course_button = $('#approvePanel .add-course')
717
 
718
 
737
         prev_select = add_course_button.prev();
738
         prev_select = add_course_button.prev();
738
       });
739
       });
739
       prev_select.remove();
740
       prev_select.remove();
740
-      */
741
+      
741
       course = selected_course[0];
742
       course = selected_course[0];
742
       var new_option = $('<option/>',{
743
       var new_option = $('<option/>',{
743
         'value': '('+course.code+','+course.number+')',
744
         'value': '('+course.code+','+course.number+')',
753
 
754
 
754
     }
755
     }
755
   );
756
   );
756
-}
757
+}*/
757
 
758
 
758
 function add_objective_select(element) {
759
 function add_objective_select(element) {
759
   var prev_select = $(element).prev();
760
   var prev_select = $(element).prev();
879
 $('#approvalSelectTA').parent().on('change', function()
880
 $('#approvalSelectTA').parent().on('change', function()
880
 {
881
 {
881
   var ta_id = $(this).find('select').val();
882
   var ta_id = $(this).find('select').val();
882
-  if(ta_id != 0){
883
-    load_ta_info_for_approval(ta_id);
884
-    }
883
+  //if(ta_id != 0){
884
+  //  load_ta_info_for_approval(ta_id);
885
+  //  }
885
 });
886
 });
886
 
887
 
887
 
888
 
959
         if(panel_id=='editPanel'){
960
         if(panel_id=='editPanel'){
960
           load_ta_info_for_edit(ta_id);
961
           load_ta_info_for_edit(ta_id);
961
         }
962
         }
962
-        if(panel_id=='approvePanel'){
963
-          load_ta_info_for_approval(ta_id);
964
-        }
963
+       // if(panel_id=='approvePanel'){
964
+       //   load_ta_info_for_approval(ta_id);
965
+       // }
965
       }
966
       }
966
     }
967
     }
967
   );
968
   );

+ 12
- 4
app/views/local/managers/sCoords/_navigation.blade.php View File

5
     </div>-->
5
     </div>-->
6
     <ul class="nav navbar-nav navbar-right">
6
     <ul class="nav navbar-nav navbar-right">
7
       <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
7
       <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
8
-      <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
9
-      <li class="dropdown">
8
+           <li class="dropdown">
10
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
9
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
11
         <ul class="dropdown-menu" role="menu">
10
         <ul class="dropdown-menu" role="menu">
12
           <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
11
           <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
13
           <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
12
           <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
14
         </ul>
13
         </ul>
15
       </li>
14
       </li>
16
-      <li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives')}}</li>
15
+      <li class="dropdown">
16
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Management<span class="caret"></span></a>
17
+        <ul class="dropdown-menu" role="menu">
18
+<li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives')}}</li>
17
       <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
19
       <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
18
-      @if(count(Auth::user()->courses))
20
+ <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
21
+ <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>
22
+
23
+
24
+      </ul>
25
+      </li>
26
+            @if(count(Auth::user()->courses))
19
       <li> {{ HTML::linkAction('ProfessorsController@overview', 'My Courses', NULL) }}</li>
27
       <li> {{ HTML::linkAction('ProfessorsController@overview', 'My Courses', NULL) }}</li>
20
       <li class="dropdown">
28
       <li class="dropdown">
21
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Sections<span class="caret"></span></a>
29
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Sections<span class="caret"></span></a>

+ 14
- 7
app/views/local/managers/sCoords/annual-plans.blade.php View File

120
         var table = $('.datatable').DataTable();
120
         var table = $('.datatable').DataTable();
121
         
121
         
122
         table.clear();
122
         table.clear();
123
+
124
+        var optionsForTADict ={};
123
         
125
         
124
 
126
 
125
 
127
 
161
           nextLetter= nextChar(nextLetter);
163
           nextLetter= nextChar(nextLetter);
162
           for(course in courses[objectives[objective].id]){
164
           for(course in courses[objectives[objective].id]){
163
             
165
             
164
-            courseshtml += ' &#8226; '+courses[objectives[objective].id][course].code+' '+courses[objectives[objective].id][course].number+'<br>'
165
-            courseTAhtml += ' &#8226; '+courses[objectives[objective].id][course].code+' '+courses[objectives[objective].id][course].number+'<br>'
166
+            courseshtml += ' &#8226; '+courses[objectives[objective].id][course].code+' '+courses[objectives[objective].id][course].name+'<br>'
167
+            courseTAhtml += ' &#8226; '+courses[objectives[objective].id][course].code+' '+courses[objectives[objective].id][course].name+'<br>'
166
       
168
       
167
             $divForEach =$('<div/>',{
169
             $divForEach =$('<div/>',{
168
             'id':'objective-'+objectives[objective].id
170
             'id':'objective-'+objectives[objective].id
214
             
216
             
215
           }
217
           }
216
           }
218
           }
219
+          typ_course_id = courses[objectives[objective].id][course].typ_course_id
217
           var $buttonTA = $('<button/>', {
220
           var $buttonTA = $('<button/>', {
218
            'type': 'button',
221
            'type': 'button',
219
            'class': 'btn btn-secondary',
222
            'class': 'btn btn-secondary',
220
-            'onclick': 'addTAselect("'+optionsForTa+'", "forTA-objective-'+objectives[objective].id+'-course-'+courses[objectives[objective].id][course].typ_course_id+'", '+annual_plan+', '+objectives[objective].id+', '+typ_objective_id+', 0)'
223
+
224
+            'onclick': 'addTAselect("'+optionsForTa+'", "forTA-objective-'+objectives[objective].id+'-course-'+courses[objectives[objective].id][course].typ_course_id+'", '+annual_plan+', '+objectives[objective].id+', '+typ_course_id+', 0)'
221
   });
225
   });
222
            
226
            
223
           $buttonTA.append("+ Add TA");
227
           $buttonTA.append("+ Add TA");
224
-
225
-
228
+          typ_course_id = courses[objectives[objective].id][course].typ_course_id
229
+          optionsForTADict[typ_course_id] = optionsForTa;
226
           
230
           
227
           
231
           
228
 
232
 
236
             
240
             
237
             courseshtml += $divForEach[0].innerHTML +"<br><br>";
241
             courseshtml += $divForEach[0].innerHTML +"<br><br>";
238
             courseTAhtml += $divForTA[0].innerHTML +"<br><br>";
242
             courseTAhtml += $divForTA[0].innerHTML +"<br><br>";
243
+
244
+          
239
           }
245
           }
240
 
246
 
241
 
247
 
308
        if(json.annual_plans_transformative[objectives[objective].id][typ_course_id].length){
314
        if(json.annual_plans_transformative[objectives[objective].id][typ_course_id].length){
309
             for(i=0; i<json.annual_plans_transformative[objectives[objective].id][typ_course_id].length; i++){
315
             for(i=0; i<json.annual_plans_transformative[objectives[objective].id][typ_course_id].length; i++){
310
               selected_ta = json.annual_plans_transformative[objectives[objective].id][typ_course_id][i].trans_id;
316
               selected_ta = json.annual_plans_transformative[objectives[objective].id][typ_course_id][i].trans_id;
311
-              addTAselect(optionsForTa, "forTA-objective-"+objectives[objective].id+'-course-'+typ_course_id, annual_plan, objectives[objective].id, typ_course_id, selected_ta);
317
+              addTAselect(optionsForTADict[typ_course_id], "forTA-objective-"+objectives[objective].id+'-course-'+typ_course_id, annual_plan, objectives[objective].id, typ_course_id, selected_ta);
312
               
318
               
313
             }
319
             }
314
           }
320
           }
315
             else{
321
             else{
316
-              addTAselect(optionsForTa, "forTA-objective-"+objectives[objective].id+'-course-'+typ_course_id, annual_plan, objectives[objective].id, typ_course_id, 0);
322
+              $('#')
323
+              addTAselect(optionsForTADict[typ_course_id], "forTA-objective-"+objectives[objective].id+'-course-'+typ_course_id, annual_plan, objectives[objective].id, typ_course_id, 0);
317
             }
324
             }
318
         if(json.selected_criteria[objectives[objective].id][typ_course_id].length){
325
         if(json.selected_criteria[objectives[objective].id][typ_course_id].length){
319
          
326
          

+ 22
- 5
app/views/local/managers/sCoords/objectives.blade.php View File

17
                 <div id='outcomeGroup'>
17
                 <div id='outcomeGroup'>
18
                     <label> Associated Outcome</label>
18
                     <label> Associated Outcome</label>
19
                     <div class="form-group col-md-11" id='outcomeForm'>
19
                     <div class="form-group col-md-11" id='outcomeForm'>
20
+                        <select id="outcome[0]" name="outcome[0]" class="form-control selectpicker">
21
+                            @foreach ($outcomes as $outcome)
22
+                            <option value="{{ $outcome->id }}">
23
+                                {{ $outcome->name }}
24
+    
25
+    
26
+    
27
+                            </option>
28
+                            @endforeach
29
+                        </select>
20
 
30
 
21
-
22
-                        {{ Form::select('outcome[0]', $outcomes, null, ['class'=>'form-control selectpicker', 'id' =>'outcome[0]']) }}
23
-
31
+                      
24
                     </div>
32
                     </div>
25
 
33
 
26
                 </div>
34
                 </div>
115
                 <div class="form-group">
123
                 <div class="form-group">
116
                     <div id='assocOutcomeGroup'>
124
                     <div id='assocOutcomeGroup'>
117
                         <label>Associated Outcome</label>
125
                         <label>Associated Outcome</label>
118
-
119
-                        {{ Form::select('assoc_outcome[]', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome0']) }}
126
+                        <select id="assoc_outcome0" name="assoc_outcome[]" class="form-control selectpicker">
127
+                            @foreach ($outcomes as $outcome)
128
+                            <option value="{{ $outcome->id }}">
129
+                                {{ $outcome->name }}
130
+    
131
+    
132
+    
133
+                            </option>
134
+                            @endforeach
135
+                        </select>
136
+                   
120
 
137
 
121
                     </div>
138
                     </div>
122
                 </div>
139
                 </div>

+ 10
- 10
app/views/local/managers/sCoords/view-annual-plans.blade.php View File

207
                "style": "table-layout: fixed",
207
                "style": "table-layout: fixed",
208
                "id": 'allReportToExport',
208
                "id": 'allReportToExport',
209
               "data-title": plan});
209
               "data-title": plan});
210
-        $thead = $('<thead/>').html("<tr><th>Objectives for courses</th><th>Criteria per Courses</th><th>Transformative Actions</th><th>Expected Outcome</th></tr>");
210
+        $thead = $('<thead/>').html("<tr><th>Objectives for courses</th><th>Criteria per Courses</th><th>Transformative Actions</th></tr>");
211
         $tbody = $('<tbody/>');
211
         $tbody = $('<tbody/>');
212
         $tableForAll.append($thead);
212
         $tableForAll.append($thead);
213
         $tableForAll.append($tbody);
213
         $tableForAll.append($tbody);
275
                "id": json.first.outcomes[outcome].id +'first',
275
                "id": json.first.outcomes[outcome].id +'first',
276
                "data-title": json.first.outcomes[outcome].name
276
                "data-title": json.first.outcomes[outcome].name
277
              })
277
              })
278
-             $thead = $('<thead/>').html("<tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th><th>Expected Outcome</th></tr>")
278
+             $thead = $('<thead/>').html("<tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th></tr>")
279
              $table.append($thead);
279
              $table.append($thead);
280
              $table.append($('<tbody/>')); 
280
              $table.append($('<tbody/>')); 
281
              $divTable.append($table);
281
              $divTable.append($table);
302
 
302
 
303
                 for(criterion in json.first.criteria[theObj.id][theCourse.typ_course_id]){
303
                 for(criterion in json.first.criteria[theObj.id][theCourse.typ_course_id]){
304
                   theCrit = json.first.criteria[theObj.id][theCourse.typ_course_id][criterion];
304
                   theCrit = json.first.criteria[theObj.id][theCourse.typ_course_id][criterion];
305
-                  courseHTML += '\t&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n<br>';
305
+                  courseHTML += '\t&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n\n<br>';
306
                   
306
                   
307
                 }
307
                 }
308
                 for(trans in json.first.trans_actions[theObj.id][theCourse.typ_course_id]){
308
                 for(trans in json.first.trans_actions[theObj.id][theCourse.typ_course_id]){
309
                   theTA = json.first.trans_actions[theObj.id][theCourse.typ_course_id][trans]
309
                   theTA = json.first.trans_actions[theObj.id][theCourse.typ_course_id][trans]
310
-                  courseTAhtml +='\t&nbsp;&nbsp; '+(parseInt(trans)+1)+". "+theTA.at_text+'\n<br>'; 
310
+                  courseTAhtml +='\t&nbsp;&nbsp; '+(parseInt(trans)+1)+". "+theTA.description+'\n\n<br>'; 
311
                 }
311
                 }
312
               }
312
               }
313
               //courseHTML += '</ul>';
313
               //courseHTML += '</ul>';
417
                "id": json.second.outcomes[outcome].id +'second',
417
                "id": json.second.outcomes[outcome].id +'second',
418
                "data-title": json.second.outcomes[outcome].name
418
                "data-title": json.second.outcomes[outcome].name
419
              })
419
              })
420
-             $thead = $('<thead/>').html("<tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th><th>Expected Outcome</tr>")
420
+             $thead = $('<thead/>').html("<tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th></tr>")
421
              $table.append($thead);
421
              $table.append($thead);
422
              $table.append($('<tbody/>')); 
422
              $table.append($('<tbody/>')); 
423
              $divTable.append($table);
423
              $divTable.append($table);
443
                 courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
443
                 courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
444
                 for(criterion in json.second.criteria[theObj.id][theCourse.typ_course_id]){
444
                 for(criterion in json.second.criteria[theObj.id][theCourse.typ_course_id]){
445
                   theCrit = json.second.criteria[theObj.id][theCourse.typ_course_id][criterion];
445
                   theCrit = json.second.criteria[theObj.id][theCourse.typ_course_id][criterion];
446
-                  courseHTML += '&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n<br>';
446
+                  courseHTML += '&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n\n<br>';
447
 
447
 
448
 
448
 
449
                 }
449
                 }
450
 
450
 
451
                 for(trans in json.second.trans_actions[theObj.id][theCourse.typ_course_id]){
451
                 for(trans in json.second.trans_actions[theObj.id][theCourse.typ_course_id]){
452
                   theTA = json.second.trans_actions[theObj.id][theCourse.typ_course_id][trans]
452
                   theTA = json.second.trans_actions[theObj.id][theCourse.typ_course_id][trans]
453
-                  courseTAhtml +='\t&nbsp;&nbsp; '+(parseInt(trans)+1)+". "+theTA.at_text+'\n<br>'; 
453
+                  courseTAhtml +='\t&nbsp;&nbsp; '+(parseInt(trans)+1)+". "+theTA.description+'\n\n<br>'; 
454
                 }
454
                 }
455
               }
455
               }
456
               //courseHTML += '</ul>';
456
               //courseHTML += '</ul>';
585
                                     tableCopy = doc.content[1];
585
                                     tableCopy = doc.content[1];
586
                                     doc.content[1] = { text: dt.exportOptions.text, style:'title', margin : [0,0,0,12]};
586
                                     doc.content[1] = { text: dt.exportOptions.text, style:'title', margin : [0,0,0,12]};
587
                                     doc.content[2] =tableCopy;
587
                                     doc.content[2] =tableCopy;
588
-                                    doc.content[2].table.widths =['20%', '20%', '20%', '20%', '20%']
588
+                                    doc.content[2].table.widths =['33%', '33%', '34%']
589
                                     doc.pageSize = 'LEGAL';
589
                                     doc.pageSize = 'LEGAL';
590
                                     doc.pageOrientation ='landscape';
590
                                     doc.pageOrientation ='landscape';
591
                                     doc.defaultStyle.fontSize = 10;
591
                                     doc.defaultStyle.fontSize = 10;
755
                                       
755
                                       
756
 
756
 
757
                                       doc.content.push({text:title,style:"title", margin:[0,0,0,12],  });
757
                                       doc.content.push({text:title,style:"title", margin:[0,0,0,12],  });
758
-                                      doc.content.push({table: {body:body1, headerRows:1, widths:['20%', '20%', '20%', '20%', '20%']},layout:"noBorders", pageBreak:'after'});
758
+                                      doc.content.push({table: {body:body1, headerRows:1, widths:['33%', '33%', '34%']},layout:"noBorders", pageBreak:'after'});
759
 
759
 
760
 
760
 
761
                                       
761
                                       
1166
                                         suggested = json_to_use.suggested[trans][0];
1166
                                         suggested = json_to_use.suggested[trans][0];
1167
                                       }
1167
                                       }
1168
                                       else suggested =0;
1168
                                       else suggested =0;
1169
-                                      title_trans = this_is_the_json[trans].at_text;
1169
+                                      title_trans = this_is_the_json[trans].description;
1170
                                       json_outcomes = json_to_use.outcomes[trans];
1170
                                       json_outcomes = json_to_use.outcomes[trans];
1171
                                       if(suggested){
1171
                                       if(suggested){
1172
                                       doc.content.push({text:'\n\n'+title_trans+'['+suggested.surnames + ', '+suggested.first_name+']' ,style:"title", margin:[0,0,0,12],  });
1172
                                       doc.content.push({text:'\n\n'+title_trans+'['+suggested.surnames + ', '+suggested.first_name+']' ,style:"title", margin:[0,0,0,12],  });

+ 1
- 1
app/views/local/professors/_navigation.blade.php View File

8
       <li>{{ HTML::linkAction('ProfessorsController@overview', 'My Courses') }}</li>
8
       <li>{{ HTML::linkAction('ProfessorsController@overview', 'My Courses') }}</li>
9
       {{-- la linea siguiente comentada es lo que habia originalmente. tanto la linea como este comentario se pueden borrar --}}
9
       {{-- la linea siguiente comentada es lo que habia originalmente. tanto la linea como este comentario se pueden borrar --}}
10
       {{-- <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li> --}}
10
       {{-- <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li> --}}
11
-      <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>
11
+      {{--<li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Transformative Actions') }}</li>--}}
12
       <li class="dropdown">
12
       <li class="dropdown">
13
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
13
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
14
         <ul class="dropdown-menu" role="menu">
14
         <ul class="dropdown-menu" role="menu">