Browse Source

Los cambios mas recientes unidos con oniel

parent
commit
5abdadd370
25 changed files with 1700 additions and 399 deletions
  1. 57
    17
      app/controllers/CriteriaController.php
  2. 42
    14
      app/controllers/Objective2Controller.php
  3. 15
    0
      app/controllers/ObjectivesController.php
  4. 85
    3
      app/controllers/OutcomesController.php
  5. 93
    1
      app/controllers/ProgramsController.php
  6. 44
    0
      app/database/migrations/2018_08_28_140328_remove_outcome_id_from_objectives_table.php
  7. 38
    0
      app/database/migrations/2020_04_04_005817_add_outcome_id_to_objectives_table.php
  8. 47
    0
      app/database/migrations/2021_01_28_160558_ObjectiveProgramMigrate.php
  9. 33
    0
      app/database/migrations/2021_01_28_174905_fixObjectivesTable.php
  10. 2
    2
      app/filters.php
  11. 12
    4
      app/routes.php
  12. 32
    2
      app/views/global/view-learning-outcomes-criteria.blade.php
  13. 170
    0
      app/views/global/view-objectives-criteria.blade.php
  14. 7
    1
      app/views/local/managers/admins/_navigation.blade.php
  15. 7
    5
      app/views/local/managers/admins/criteria.blade.php
  16. 148
    39
      app/views/local/managers/admins/objectives.blade.php
  17. 8
    1
      app/views/local/managers/pCoords/_navigation.blade.php
  18. 97
    34
      app/views/local/managers/pCoords/objectives.blade.php
  19. 7
    1
      app/views/local/managers/sCoords/_navigation.blade.php
  20. 103
    38
      app/views/local/managers/sCoords/objectives.blade.php
  21. 239
    228
      app/views/local/managers/shared/program.blade.php
  22. 303
    0
      app/views/local/managers/shared/program_report.blade.php
  23. 95
    1
      app/views/local/managers/shared/programs.blade.php
  24. 16
    8
      app/views/local/professors/_navigation.blade.php
  25. BIN
      trabajoRealizado. primer semestre 2020-2021.pdf

+ 57
- 17
app/controllers/CriteriaController.php View File

@@ -87,17 +87,17 @@ class CriteriaController extends \BaseController
87 87
 
88 88
     public function delete()
89 89
     {
90
-        DB::delete("delete from new_criteria where id = ?", array(Input::get('id')));
90
+        DB::delete("delete from new_criteria where id = ?", array(Input::get('criterion_delete')));
91 91
         $role = Auth::user()['role'];
92 92
         switch ($role) {
93 93
             case 1:
94
-                return Redirect::to('objective')->withInput();
94
+                return Redirect::to('criteria')->withInput();
95 95
 
96 96
             case 2:
97
-                return Redirect::to('school-objective')->withInput();
97
+                return Redirect::to('school-criteria')->withInput();
98 98
 
99 99
             case 3:
100
-                return Redirect::to('program-objective')->withInput();
100
+                return Redirect::to('program-criteria')->withInput();
101 101
         }
102 102
     }
103 103
     public function isCriterionUnique($input, $existing_criterion = NULL)
@@ -225,13 +225,13 @@ class CriteriaController extends \BaseController
225 225
             $role = Auth::user()['role'];
226 226
             switch ($role) {
227 227
                 case 1:
228
-                    return Redirect::to('objective')->withInput();
228
+                    return Redirect::to('criteria')->withInput();
229 229
 
230 230
                 case 2:
231
-                    return Redirect::to('school-objective')->withInput();
231
+                    return Redirect::to('school-criteria')->withInput();
232 232
 
233 233
                 case 3:
234
-                    return Redirect::to('program-objective')->withInput();
234
+                    return Redirect::to('program-criteria')->withInput();
235 235
             }
236 236
         } else {
237 237
             // Check criterion uniqueness
@@ -288,13 +288,13 @@ class CriteriaController extends \BaseController
288 288
                         $role = Auth::user()['role'];
289 289
                         switch ($role) {
290 290
                             case 1:
291
-                                return Redirect::to('objective')->withInput();
291
+                                return Redirect::to('criteria')->withInput();
292 292
 
293 293
                             case 2:
294
-                                return Redirect::to('school-objective')->withInput();
294
+                                return Redirect::to('school-criteria')->withInput();
295 295
 
296 296
                             case 3:
297
-                                return Redirect::to('program-objective')->withInput();
297
+                                return Redirect::to('program-criteria')->withInput();
298 298
                         }
299 299
                     }
300 300
                 }
@@ -308,13 +308,13 @@ class CriteriaController extends \BaseController
308 308
                 $role = Auth::user()['role'];
309 309
                 switch ($role) {
310 310
                     case 1:
311
-                        return Redirect::to('objective')->withInput();
311
+                        return Redirect::to('criteria')->withInput();
312 312
 
313 313
                     case 2:
314
-                        return Redirect::to('school-objective')->withInput();
314
+                        return Redirect::to('school-criteria')->withInput();
315 315
 
316 316
                     case 3:
317
-                        return Redirect::to('program-objective')->withInput();
317
+                        return Redirect::to('program-criteria')->withInput();
318 318
                 }
319 319
             }
320 320
 
@@ -325,13 +325,13 @@ class CriteriaController extends \BaseController
325 325
                 $role = Auth::user()['role'];
326 326
                 switch ($role) {
327 327
                     case 1:
328
-                        return Redirect::to('objective')->withInput();
328
+                        return Redirect::to('criteria')->withInput();
329 329
 
330 330
                     case 2:
331
-                        return Redirect::to('school-objective')->withInput();
331
+                        return Redirect::to('school-criteria')->withInput();
332 332
 
333 333
                     case 3:
334
-                        return Redirect::to('program-objective')->withInput();
334
+                        return Redirect::to('program-criteria')->withInput();
335 335
                 }
336 336
             }
337 337
         }
@@ -550,15 +550,55 @@ class CriteriaController extends \BaseController
550 550
             }
551 551
         }
552 552
     }
553
+    // copie index() y lo edite
554
+    public function objectivesIndex()
555
+    {
556
+        if (Auth::user()->role == 1) {
557
+            //uscar todos los objetivos
558
+            $objectives = DB::table('program_user')
559
+                ->join('objectives', 'objectives.program_id', '=', 'program_user.program_id')
560
+                ->join('programs', 'programs.id', '=', 'program_user.program_id')
561
+                ->select('objectives.id', 'objectives.text', 'programs.name')
562
+                ->orderBy('objectives.text', 'asc')
563
+                ->get();
564
+        } elseif (Auth::user()->role == 2) {
565
+            //buscar los objetivos de la departamento (school)
566
+            $objectives = DB::table('program_user')
567
+                ->join('objectives', 'objectives.program_id', '=', 'program_user.program_id')
568
+                ->join('programs', 'programs.id', '=', 'program_user.program_id')
569
+                ->where('programs.school_id', Auth::user()->school_id)
570
+                ->select('objectives.id', 'objectives.text', 'programs.name')
571
+                ->orderBy('objectives.text', 'asc')
572
+                ->get();
573
+        } elseif ((Auth::user()->role == 3) || (Auth::user()->role == 4)) {
574
+            //buscar los objetivos de los programas cuales el profesor esta
575
+            $objectives = DB::table('program_user')
576
+                ->join('objectives', 'objectives.program_id', '=', 'program_user.program_id')
577
+                ->join('programs', 'programs.id', '=', 'program_user.program_id')
578
+                ->where('program_user.user_id', Auth::user()->id)
579
+                ->select('objectives.id', 'objectives.text', 'programs.name')
580
+                ->orderBy('objectives.text', 'asc')
581
+                ->get();
582
+        }
583
+
584
+        $title = "Learning Objectives and Criteria";
553 585
 
586
+        return View::make('global.view-objectives-criteria', compact('title', 'objectives'));
587
+    }
554 588
     public function index()
555 589
     {
590
+        // el ID de los semestres que el usuario tiene seleccionado.
591
+        $semesters_ids = Session::get('semesters_ids');
592
+        // buscar informacion de los semestres seleccionados
593
+        $semesters = Semester::whereIn('id', $semesters_ids)->get();
594
+
556 595
         $title = "Learning Outcomes and Criteria";
557 596
         $outcomes = Outcome::orderBy('name', 'ASC')->get();
558 597
         $schools = School::orderBy('name', 'ASC')->get();
559 598
         $criteria = Criterion::withTrashed()->orderBy('name', 'ASC')->get();
560 599
 
561
-        return View::make('global.view-learning-outcomes-criteria', compact('title', 'outcomes', 'schools', 'criteria'));
600
+        // se annadio la nueva variable
601
+        return View::make('global.view-learning-outcomes-criteria', compact('title', 'outcomes', 'schools', 'criteria', 'semesters'));
562 602
     }
563 603
 
564 604
     public function destroy()

+ 42
- 14
app/controllers/Objective2Controller.php View File

@@ -70,7 +70,7 @@ class Objective2Controller extends \BaseController
70 70
 				'text' => 'required|string',
71 71
 
72 72
 				'outcome_id' => 'required|array',
73
-				'program_id' => 'required|numeric|integer'
73
+				'program_id' => 'required|array'
74 74
 
75 75
 			)
76 76
 
@@ -92,7 +92,7 @@ class Objective2Controller extends \BaseController
92 92
 			$clean_input['outcome_id'][$i] = trim(preg_replace('/\t+/', '', $clean_input['outcome_id'][$i]));
93 93
 		}
94 94
 
95
-		$clean_input['program_id'] = trim(preg_replace('/\t+/', '', Input::get('program_id')));
95
+		$clean_input['program_id'] = Input::get('program_id');
96 96
 
97 97
 
98 98
 		return $clean_input;
@@ -109,7 +109,7 @@ class Objective2Controller extends \BaseController
109 109
 
110 110
 
111 111
 
112
-		$clean_input['program_id'] = trim(preg_replace('/\t+/', '', Input::get('program_id')));
112
+		$clean_input['program_id'] = Input::get('program_id');
113 113
 
114 114
 
115 115
 		return $clean_input;
@@ -121,7 +121,37 @@ class Objective2Controller extends \BaseController
121 121
 
122 122
 	public function fetchObjectiveWithTrashed()
123 123
 	{
124
-		return json_encode(DB::select('select o.id, o.program_id, o.text, outc.outcome_id outcome_id from objectives o, objective_outcome outc where o.id = ? and o.id = outc.objective_id', array(Input::get('id'))));
124
+		$json = array();
125
+
126
+		$json['program'] = DB::select("select program_id from objective_program where objective_id = ?", array(Input::get('id')));
127
+		$json['outcome'] = DB::select("select outcome_id from objective_outcome outc where outc.objective_id = ?", array(Input::get('id')));
128
+		$json['objective'] = DB::select("select text, id from objectives where id =?", array(Input::get('id')));
129
+		$json['assessment'] = DB::select("select * from assessments where activity_id  in (select activity_id from activity_criterion where criterion_id in (select criterion_id from criterion_objective_outcome where objective_id = ?))", array(Input::get('id')));
130
+		$json['assoc_criteria'] = DB::select("select name from criteria where id in(select criterion_id from criterion_objective_outcome where objective_id =?)", array(Input::get('id')));
131
+		return json_encode($json);
132
+	}
133
+	public function fetchAllobjectives()
134
+	{
135
+		$program_id = Input::get('program_fetch');
136
+		$outcome_id = Input::get('outcome_fetch');
137
+		$json = array();
138
+		$json['objective'] = DB::select("SELECT * FROM `objectives` where id in (select objective_id from criterion_objective_outcome where outcome_id ={$outcome_id}) and id in(select objective_id from objective_program where program_id = {$program_id})");
139
+		return json_encode($json);
140
+	}
141
+	public function delete()
142
+	{
143
+		DB::delete("delete from objectives where id = ?", array(Input::get('deleteObj')));
144
+		$role = Auth::user()['role'];
145
+		switch ($role) {
146
+			case 1:
147
+				return Redirect::to('objectives')->withInput();
148
+
149
+			case 2:
150
+				return Redirect::to('school-objectives')->withInput();
151
+
152
+			case 3:
153
+				return Redirect::to('program-objectives')->withInput();
154
+		}
125 155
 	}
126 156
 	/**
127 157
 	 * Create a new Objective.
@@ -187,16 +217,15 @@ class Objective2Controller extends \BaseController
187 217
 
188 218
 
189 219
 
190
-			// Set program
191
-			if (Input::get('program_id') != 0)
192
-				$objective->program_id = $clean_input['program_id'];
193
-			else
194
-				$objective->program_id = NULL;
220
+
195 221
 
196 222
 
197 223
 			/** If Objective is saved, send success message */
198 224
 			if ($objective->save()) {
199 225
 				$objectiveId = $objective->id;
226
+				foreach ($clean_input['program_id'] as $program_id) {
227
+					DB::insert("insert into objective_program (objective_id, program_id) values({$objectiveId},{$program_id})");
228
+				}
200 229
 				foreach ($clean_input['outcome_id'] as $outcome_id) {
201 230
 					DB::insert("insert into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
202 231
 
@@ -369,11 +398,6 @@ class Objective2Controller extends \BaseController
369 398
 
370 399
 
371 400
 
372
-			// Set program
373
-			if (Input::get('program_id') != 0)
374
-				$Objective->program_id = Input::get('program_id');
375
-			else
376
-				$Objective->program_id = NULL;
377 401
 
378 402
 			// Set status
379 403
 
@@ -383,7 +407,11 @@ class Objective2Controller extends \BaseController
383 407
 
384 408
 				$objectiveId = $Objective->id;
385 409
 				DB::delete("delete from `objective_outcome` where objective_id ={$objectiveId}");
410
+				DB::delete("delete from objective_program where objective_id = {$objectiveId}");
386 411
 
412
+				foreach ($clean_input['program_id'] as $program_id) {
413
+					DB::insert("insert into `objective_program`(objective_id, program_id) values ({$objectiveId},{$program_id})");
414
+				}
387 415
 				foreach ($clean_input['outcome_id'] as $outcome_id) {
388 416
 					DB::insert("insert into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
389 417
 				}

+ 15
- 0
app/controllers/ObjectivesController.php View File

@@ -234,4 +234,19 @@ class ObjectivesController extends \BaseController {
234 234
 
235 235
     return json_encode($res);
236 236
   }
237
+
238
+  public function fetchObjectiveForCriteria()
239
+  {
240
+      $id = Input::get('id');
241
+
242
+      $objective = Objective::find($id);
243
+
244
+      $objective->program;
245
+      $objective->criteria;
246
+
247
+      return array
248
+      (
249
+          'objective' => $objective
250
+      );
251
+  }
237 252
 }

+ 85
- 3
app/controllers/OutcomesController.php View File

@@ -14,8 +14,11 @@ class OutcomesController extends \BaseController {
14 14
         $title = "Learning Outcomes";
15 15
         $outcomes = Outcome::withTrashed()->orderBy('name', 'ASC')->get();
16 16
         $schools = School::orderBy('name', 'ASC')->get();
17
+        // $semesters_ids = Session::get('semesters_ids');
18
+        // $semesters = Semester::whereIn('id',$semesters_ids)->get();
17 19
 
18 20
         return View::make('local.managers.admins.learning-outcomes', compact('title', 'outcomes', 'schools'));
21
+        //return View::make('local.managers.admins.learning-outcomes', compact('title', 'outcomes', 'schools','semesters'));
19 22
     }
20 23
 
21 24
     // TODO: Change to home page
@@ -295,6 +298,85 @@ class OutcomesController extends \BaseController {
295 298
         return;
296 299
     }
297 300
 
301
+    /**
302
+    *Copy of update(), but also updates activation_date, deactivation_date and level
303
+    */
304
+    public function updateMore()
305
+    {
306
+        $outcomeArray = json_decode(Input::get('outcomeArray'), true);
307
+        Session::flash('status', 'success');
308
+        Session::flash('message', 'Learning Outcomes updated.');
309
+
310
+        foreach ($outcomeArray as $outcomeObject)
311
+        {
312
+
313
+
314
+            $validator = Validator::make(
315
+                array(
316
+                    'name' => $outcomeObject['name'],
317
+                    'definition' => $outcomeObject['definition'],
318
+                    'expected_outcome' => $outcomeObject['expected_outcome']
319
+                    // TODO- validar los otros 3 valores
320
+                ),
321
+                array(
322
+                    'name' => 'required',
323
+                    'definition' => 'required',
324
+                    'expected_outcome' => 'required|numeric'
325
+                    // TODO- los requisitos de los otros 3 valores
326
+                )
327
+            );
328
+
329
+            if(!$validator->fails())
330
+            {
331
+                try
332
+                {
333
+                    $outcome = Outcome::withTrashed()
334
+                        ->where('id','=', $outcomeObject['id'])
335
+                        ->firstOrFail();
336
+                    $outcome->name = $outcomeObject['name'];
337
+                    $outcome->definition = $outcomeObject['definition'];
338
+                    $outcome->expected_outcome = $outcomeObject['expected_outcome'];
339
+                    $outcome->activation_date = $outcomeObject['activation_date'];
340
+                    $outcome->deactivation_date = $outcomeObject['deactivation_date'];
341
+                    $outcome->level = $outcomeObject['level'];
342
+                    $outcome->save();
343
+
344
+                    // If delete is 1, and outcome isn't already trashed, delete
345
+                    if($outcomeObject['delete']==1 && !$outcome->trashed())
346
+                        $outcome->delete();
347
+                    // If delete is 0, and outcome is already trashed, restore
348
+                    elseif($outcomeObject['delete']==0 && $outcome->trashed())
349
+                        $outcome->restore();
350
+                }
351
+
352
+                catch(Exception $e)
353
+                {
354
+
355
+                    Session::flash('message', $e->getMessage());
356
+                }
357
+            }
358
+            else
359
+            {
360
+                /** Prepare error message */
361
+                $message = 'Error(s) updating the Learning Outcomes: <ul>';
362
+
363
+                foreach ($validator->messages()->all('<li>:message</li>') as $validationError)
364
+                {
365
+                    $message.=$validationError;
366
+                }
367
+
368
+                $message.='</ul>';
369
+
370
+                /** Send error message and old data */
371
+                Session::flash('status', 'danger');
372
+                Session::flash('message', $message);
373
+                return;
374
+            }
375
+        }
376
+
377
+        return;
378
+    }
379
+
298 380
     public function fetchCriteria()
299 381
     {
300 382
 
@@ -391,7 +473,7 @@ class OutcomesController extends \BaseController {
391 473
             /** Send error message and old data */
392 474
             Session::flash('status', 'warning');
393 475
             Session::flash('message', $message);
394
-            return Redirect::to('learning-outcomes-criteria')->withInput();
476
+            return Redirect::to('learning-outcomes')->withInput();
395 477
         }
396 478
         else
397 479
         {
@@ -405,7 +487,7 @@ class OutcomesController extends \BaseController {
405 487
             {
406 488
                 Session::flash('status', 'success');
407 489
                 Session::flash('message', '<p>Learning Outcome added.</p>');
408
-                return Redirect::to('learning-outcomes-criteria');
490
+                return Redirect::to('learning-outcomes');
409 491
             }
410 492
 
411 493
             /** If saving fails, send error message and old data */
@@ -413,7 +495,7 @@ class OutcomesController extends \BaseController {
413 495
             {
414 496
                 Session::flash('status', 'warning');
415 497
                 Session::flash('message', '<p>Error adding Learning Outcome. Please try again later.</p>');
416
-                return Redirect::to('learning-outcomes-criteria')->withInput();
498
+                return Redirect::to('learning-outcomes')->withInput();
417 499
             }
418 500
         }
419 501
     }

+ 93
- 1
app/controllers/ProgramsController.php View File

@@ -80,6 +80,97 @@ class ProgramsController extends \BaseController
80 80
 
81 81
 }
82 82
 
83
+public function showReport()
84
+{
85
+
86
+
87
+  // create an array with the ID of Semesters selected in the form
88
+  $selected_semesters_id = array();
89
+  $semesters = Semester::all();
90
+  foreach ($semesters as $semester) {
91
+    if ($semester->is_visible){
92
+      if (Input::get('semester'.$semester->id)!=null){
93
+        array_push($selected_semesters_id, $semester->id);
94
+      }
95
+    }
96
+  }
97
+  $selected_semesters = DB::table('semesters')
98
+                        ->wherein('semesters.id',$selected_semesters_id)
99
+                        ->get();
100
+
101
+  // create a srting with the selected metodos de divulgfacion
102
+  $selected_divulgaciones = '';
103
+  $divulgaciones = array('profesores','comiteDepartamental','comiteFacultadEscuela',
104
+                      'pleno','estudiantes','administrativos','senado','comunidadWeb',
105
+                      'otros');
106
+  foreach ($divulgaciones as $divulgacion) {
107
+    if (Input::get($divulgacion)!=null){
108
+      $selected_divulgaciones = $selected_divulgaciones.'\n'.Input::get($divulgacion);
109
+    }
110
+  }
111
+
112
+  //OUTCOMES Join criteria join program
113
+  $programs = DB::table('programs')
114
+                        ->select('id','name')
115
+                        ->orderBy('name', 'asc')
116
+                        ->get();
117
+
118
+
119
+
120
+   // $program
121
+   $tables_names = '{';
122
+   foreach ($programs as $program) {
123
+     $tables_names = $tables_names.'"table'.$program->id.'" : "'.$program->name.'",';// code...
124
+   }
125
+   $tables_names = $tables_names.'}';
126
+
127
+   $title = "Programs Reports";
128
+   // $title = "Program Report: ".$program->name;
129
+
130
+   $programs_info = array();
131
+   //OUTCOMES Join criteria join program
132
+   foreach ($programs as $program) {
133
+     $info_by_id = Program::find($program->id);
134
+
135
+     $domains = DB::table('outcomes')
136
+                           ->join('criteria','criteria.outcome_id','=','outcomes.id')
137
+                           ->join('programs','programs.id','=','criteria.program_id')
138
+                           ->join('courses','courses.program_id','=','programs.id')
139
+                           ->where('programs.id',$program->id)
140
+                           ->select('outcomes.name','outcomes.activation_date')
141
+                           ->distinct()
142
+                           ->orderBy('outcomes.name', 'asc')
143
+                           ->get();
144
+
145
+     $courses_used = DB::table('outcomes')
146
+                           ->join('criteria','criteria.outcome_id','=','outcomes.id')
147
+                           ->join('programs','programs.id','=','criteria.program_id')
148
+                           ->join('courses','courses.program_id','=','programs.id')
149
+                           ->where('programs.id',$program->id)
150
+                           ->select('courses.number', 'outcomes.name as domain_name', 'courses.code')
151
+                           ->distinct()
152
+                           ->orderBy('courses.name', 'asc')
153
+                           ->get();
154
+
155
+     $transformative_actions = DB::table('outcomes')
156
+                           ->join('criteria','criteria.outcome_id','=','outcomes.id')
157
+                           ->join('programs','programs.id','=','criteria.program_id')
158
+                           ->join('courses','courses.program_id','=','programs.id')
159
+                           ->join('activities','activities.course_id','=','courses.id')
160
+                           ->join('activity_criterion','activity_criterion.activity_id','=','activities.id')
161
+                           ->where('programs.id',$program->id)
162
+                           ->select('activity_criterion.transformative_actions', 'outcomes.name as domain_name')
163
+                           ->distinct()
164
+                           ->orderBy('activity_criterion.transformative_actions', 'asc')
165
+                           ->get();
166
+     $info = array($info_by_id, $domains, $courses_used, $transformative_actions);
167
+     array_push($programs_info, $info);
168
+   }
169
+
170
+
171
+   return View::make('local.managers.shared.program_report', compact('title','programs_info','selected_divulgaciones','selected_semesters','tables_names'));
172
+}
173
+
83 174
   /**
84 175
    * Info to print a program
85 176
    */
@@ -141,8 +232,9 @@ class ProgramsController extends \BaseController
141 232
     $title = "Programs by School";
142 233
     $programs = Program::orderBy('name')->get();
143 234
     $schools = School::all();
235
+    $semesters = Semester::all();
144 236
 
145
-    return View::make('local.managers.shared.programs', compact('programs', 'schools', 'title'));
237
+    return View::make('local.managers.shared.programs', compact('programs', 'schools', 'semesters', 'title'));
146 238
   }
147 239
 
148 240
   /**

+ 44
- 0
app/database/migrations/2018_08_28_140328_remove_outcome_id_from_objectives_table.php View File

@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+
6
+class RemoveOutcomeIdFromObjectivesTable extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		//Schema::table('objectives', function(Blueprint $table)
17
+		//{
18
+		//    $table->dropForeign('objectives_outcome_id_foreign');
19
+		//	$table->dropColumn('outcome_id');
20
+		//});
21
+	}
22
+
23
+
24
+	/**
25
+	 * Reverse the migrations.
26
+	 *
27
+	 * @return void
28
+	 */
29
+	public function down()
30
+	{
31
+		Schema::table('objectives', function (Blueprint $table) {
32
+			$table
33
+				->integer('outcome_id')
34
+				->after('id')
35
+				->unsigned();
36
+			$table
37
+				->foreign('outcome_id')
38
+				->references('id')
39
+				->on('outcomes')
40
+				->onDelete('cascade')
41
+				->onUpdate('cascade');
42
+		});
43
+	}
44
+}

+ 38
- 0
app/database/migrations/2020_04_04_005817_add_outcome_id_to_objectives_table.php View File

@@ -0,0 +1,38 @@
1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+
6
+class AddOutcomeIdToObjectivesTable extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		//Schema::table('objectives', function(Blueprint $table)
17
+		//{
18
+		//	$table->integer('outcome_id')->unsigned();
19
+
20
+		//	$table->foreign('outcome_id')->references('id')->on('outcomes')->onDelete('cascade')->onUpdate('cascade');
21
+		//});
22
+	}
23
+
24
+
25
+	/**
26
+	 * Reverse the migrations.
27
+	 *
28
+	 * @return void
29
+	 */
30
+	public function down()
31
+	{
32
+		Schema::table('objectives', function (Blueprint $table) {
33
+			$table->dropForeign('objectives_outcome_id_foreign');
34
+
35
+			$table->dropColumn('outcome_id');
36
+		});
37
+	}
38
+}

+ 47
- 0
app/database/migrations/2021_01_28_160558_ObjectiveProgramMigrate.php View File

@@ -0,0 +1,47 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class ObjectiveProgramMigrate extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('objective_program', function (Blueprint $table) {
17
+			$table->increments('id');
18
+			$table->integer('program_id')->unsigned();
19
+			$table->integer('objective_id')->unsigned();
20
+
21
+
22
+			$table
23
+				->foreign('objective_id')
24
+				->references('id')
25
+				->on('objectives')
26
+				->onDelete('cascade')
27
+				->onUpdate('cascade');
28
+			$table
29
+				->foreign('program_id')
30
+				->references('id')
31
+				->on('programs')
32
+				->onDelete('cascade')
33
+				->onUpdate('cascade');
34
+			$table->timestamps();
35
+		});
36
+	}
37
+
38
+	/**
39
+	 * Reverse the migrations.
40
+	 *
41
+	 * @return void
42
+	 */
43
+	public function down()
44
+	{
45
+		Schema::drop('objective_program');
46
+	}
47
+}

+ 33
- 0
app/database/migrations/2021_01_28_174905_fixObjectivesTable.php View File

@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class FixObjectivesTable extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::table('objectives', function (Blueprint $table) {
17
+
18
+			//$table->dropForeign('objectives_program_id_foreign');
19
+			//$table->dropColumn('program_id');
20
+			//$table->dropColumn('outcome_id');
21
+		});
22
+	}
23
+
24
+	/**
25
+	 * Reverse the migrations.
26
+	 *
27
+	 * @return void
28
+	 */
29
+	public function down()
30
+	{
31
+		//
32
+	}
33
+}

+ 2
- 2
app/filters.php View File

@@ -198,9 +198,9 @@ Route::filter('prof', function () {
198 198
 |
199 199
 | The CSRF filter is responsible for protecting your application against
200 200
 | cross-site request forgery attacks. If this special token in a user
201
-| session does not match the one given in this request, we'll bail.
201
+| session does not match the one given in this request, we'll bail
202 202
 |
203
-*/
203
+ */
204 204
 
205 205
 Route::filter('csrf', function () {
206 206
 	$token = Request::ajax() ? Request::header('X-CSRF-Token') : Input::get('_token');

+ 12
- 4
app/routes.php View File

@@ -226,7 +226,9 @@ Route::group(array('before' => 'auth|has_access'), function () {
226 226
 
227 227
     // Show users all learning outcomes and criteria
228 228
     Route::get('learning-outcomes-criteria', 'CriteriaController@index');
229
+    Route::get('learning-objectives-criteria', 'CriteriaController@objectivesIndex');
229 230
     Route::post('fetchOutcome', array('before' => 'csrf', 'uses' => 'OutcomesController@fetchOutcome'));
231
+    Route::post('fetchObjectiveForCriteria', array('before' => 'csrf', 'uses' => 'ObjectivesController@fetchObjectiveForCriteria'));
230 232
 
231 233
     // Show professor overview to users with courses
232 234
     Route::get('professor', 'ProfessorsController@overview');
@@ -249,8 +251,11 @@ Route::group(array('before' => 'auth|has_access'), function () {
249 251
         Route::post('createCriterion', array('before' => 'csrf', 'uses' => 'CriteriaController@create'));
250 252
 
251 253
         Route::get('learning-outcomes', 'OutcomesController@index');
254
+        Route::post('fetchObjectives', 'Objective2Controller@fetchAllObjectives');
252 255
         // TODO: Change later
253 256
         Route::get('new-learning-outcomes', 'OutcomesController@newIndex');
257
+
258
+        Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@updateMore'));
254 259
         Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@update'));
255 260
         Route::post('crtiteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
256 261
         Route::delete('crtiteria/delete', array('before' => 'csrf', 'uses' => 'CriteriaController@destroy'));
@@ -260,9 +265,11 @@ Route::group(array('before' => 'auth|has_access'), function () {
260 265
         Route::post('administrator/updateAccess', array('before' => 'csrf', 'uses' => 'UsersController@updateAccess'));
261 266
         Route::post('administrator/users/store', array('before' => 'csrf', 'uses' => 'UsersController@store'));
262 267
 
263
-
268
+        Route::get('criteria', array('uses' => 'CriteriaController@edit'));
269
+        Route::get('objectives', array('uses' => 'Objective2Controller@edit'));
264 270
         Route::get('administrator/semesters', 'SemestersController@edit');
265 271
         Route::post('administrator/semesters/update', 'SemestersController@update');
272
+        Route::post('deleteObjective', 'Objective2Controller@delete');
266 273
 
267 274
         Route::get('assessment-report/{outcome_id}', 'OutcomesController@assessmentReport');
268 275
         // TODO: Change later
@@ -285,9 +292,10 @@ Route::group(array('before' => 'auth|has_access'), function () {
285 292
         Route::get('school-coordinator', 'SchoolCoordinatorsController@overview');
286 293
         Route::get('school/{id}', 'SchoolsController@show');
287 294
         Route::get('program/{id}', 'ProgramsController@show');
295
+        Route::post('programs/report', 'ProgramsController@showReport');
288 296
         Route::get('programs', 'ProgramsController@index');
289 297
         Route::get('template-list', 'TemplatesController@schoolCoordinatorIndex');
290
-
298
+        Route::post('deleteObjective', 'Objective2Controller@delete');
291 299
         // Print school report
292 300
         Route::get('print_school/{id}', 'SchoolsController@print_school');
293 301
 
@@ -305,7 +313,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
305 313
      */
306 314
     Route::group(array('before' => 'pcoord'), function () {
307 315
         Route::get('program-coordinator', 'ProgramCoordinatorsController@overview');
308
-
316
+        Route::post('deleteObjective', 'Objective2Controller@delete');
309 317
         Route::get('rubrics', 'TemplatesController@newTemplate');
310 318
         Route::post('saveTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@create'));
311 319
         Route::post('updateTemplate', array('before' => 'csrf', 'uses' => 'TemplatesController@update'));
@@ -403,7 +411,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
403 411
         Route::post('deleteRubric', array('before' => 'csrf', 'uses' => 'RubricsController@destroy'));
404 412
         Route::get('learning-outcomes-criteria', 'CriteriaController@index');
405 413
         Route::get('export_grades/{id}', 'CoursesController@exportGrades');
406
-
414
+        Route::get('learning-objectives-criteria', 'CriteriaController@objectivesIndex');
407 415
         // Assessment reports
408 416
         Route::get('professor-assessment-report/{outcome_id}', 'OutcomesController@professorAssessmentReport');
409 417
         Route::get('professor-assessment-reports', 'OutcomesController@professorAssessmentReports');

+ 32
- 2
app/views/global/view-learning-outcomes-criteria.blade.php View File

@@ -13,12 +13,42 @@
13 13
 @stop
14 14
 
15 15
 @section('main')
16
+  {{-- TODO: look where to place this script.
17
+          if placed inside .ready() or before it,
18
+            an error that the function is not defined occurs. --}}
19
+  {{-- TODO: no reconoce acentos --}}
20
+  <script type="text/javascript">
21
+  function filterOutcomes() {
22
+    // Declare variables
23
+    var input, filter, div, li, i, outcomeText;
24
+    input = document.getElementById('userInput');
25
+    filter = input.value.toUpperCase();
26
+    div = document.getElementById("list");
27
+    li = div.getElementsByTagName('li');
28
+
29
+    // Loop through all list items, and hide those who don't match the search query
30
+    for (i = 0; i < li.length; i++) {
31
+      outcomeText = li[i].textContent;
32
+      if (outcomeText.toUpperCase().indexOf(filter) > -1) {
33
+        li[i].style.display = "";
34
+      } else {
35
+        li[i].style.display = "none";
36
+      }
37
+    }
38
+  }
39
+  </script>
16 40
 
17 41
   <div class="row">
18 42
     <div class="col-md-3">
19
-      <div class="list-group">
43
+      <input class="form-control" type="text" id="userInput" onkeyup="filterOutcomes()" placeholder="Search for Learning Outcomes..">
44
+      <div class="list-group" id='list'>
20 45
         @foreach ($outcomes as $outcome)
21
-          <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }}</li>
46
+          @foreach ($semesters as $semester)
47
+            @if(!$outcome->deleted_at && $outcome->activation_date >= $semester->start && $outcome->activation_date <= $semester->end)
48
+              {{-- <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }}</li> --}}
49
+              <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }} [{{$semester->code}}]</li>
50
+            @endif
51
+          @endforeach
22 52
         @endforeach
23 53
       </div>
24 54
     </div>

+ 170
- 0
app/views/global/view-objectives-criteria.blade.php View File

@@ -0,0 +1,170 @@
1
+@extends('layouts.master')
2
+
3
+@section('navigation')
4
+    @if(Auth::user()->role==1)
5
+      @include('local.managers.admins._navigation')
6
+    @elseif(Auth::user()->role==2)
7
+      @include('local.managers.sCoords._navigation')
8
+    @elseif(Auth::user()->role==3)
9
+      @include('local.managers.pCoords._navigation')
10
+    @elseif(Auth::user()->role==4)
11
+      @include('local.professors._navigation')
12
+    @endif
13
+@stop
14
+
15
+@section('main')
16
+  {{-- TODO: look where to place this script.
17
+          if placed inside .ready() or before it,
18
+            an error that the function is not defined occurs. --}}
19
+  {{-- TODO: no reconoce acentos --}}
20
+  <script type="text/javascript">
21
+  function filterObjectives() {
22
+    // Declare variables
23
+    var input, filter, div, li, i, objectiveText;
24
+    input = document.getElementById('userInput');
25
+    filter = input.value.toUpperCase();
26
+    div = document.getElementById("list");
27
+    li = div.getElementsByTagName('li');
28
+
29
+    // Loop through all list items, and hide those who don't match the search query
30
+    for (i = 0; i < li.length; i++) {
31
+      objectiveText = li[i].textContent;
32
+      if (objectiveText.toUpperCase().indexOf(filter) > -1) {
33
+        li[i].style.display = "";
34
+      } else {
35
+        li[i].style.display = "none";
36
+      }
37
+    }
38
+  }
39
+  </script>
40
+
41
+  <div class="row">
42
+    <div class="col-md-3">
43
+      <input class="form-control" type="text" id="userInput" onkeyup="filterObjectives()" placeholder="Search for Learning Outcomes..">
44
+      <div class="list-group" id='list'>
45
+        @foreach ($objectives as $objective)
46
+          <li data-objective-id="{{ $objective->id }}"class="list-group-item">{{ $objective->text }}</li>
47
+        @endforeach
48
+      </div>
49
+    </div>
50
+
51
+    <div class="col-md-9">
52
+      <div id="objective-display" class="panel panel-default">
53
+        <div class="panel-heading">
54
+          <h4 class=" panel-title" style="cursor:auto!important;">
55
+          </h4>
56
+        </div>
57
+        <div class="panel-body">
58
+          <p class="objective-definition "></p>
59
+            <div class="table-responsive">
60
+                <table class="table table-striped table-condensed datatable">
61
+                  <thead><tr><th>Criterion</th><th>Beginning (1-2)</th><th>In Progress (3-4)</th><th>Satisfactory (5-6)</th><th>Excellent (7-8)</th></tr></thead>
62
+                  <tfoot>
63
+                      <tr class="column-search">
64
+                          <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
65
+                          <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
66
+                          <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
67
+                          <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
68
+                          <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
69
+                      </tr>
70
+                  </tfoot>
71
+                  <tbody>
72
+                  </tbody>
73
+                </table>
74
+            </div>
75
+
76
+        </div>
77
+      </div>
78
+    </div>
79
+
80
+    <div class="col-md-9">
81
+      <div class="no-objective alert alert-info">
82
+        <p>Select a Learning Objective to view its information</p>
83
+      </div>
84
+    </div>
85
+
86
+  </div>
87
+@stop
88
+
89
+@section('included-js')
90
+    @include('global._datatables_js')
91
+@stop
92
+
93
+@section('javascript')
94
+
95
+$(document).ready(function()
96
+{
97
+  // --------------------------------------------------------------------------
98
+  // Page load
99
+  // --------------------------------------------------------------------------
100
+
101
+  // Hide accordion panel contents by default
102
+  $('.panel-group .panel-body').hide();
103
+
104
+  $('#objective-display').parent().hide();
105
+
106
+  // --------------------------------------------------------------------------
107
+  // Functions
108
+  // --------------------------------------------------------------------------
109
+
110
+  // --------------------------------------------------------------------------
111
+  // Events
112
+  // --------------------------------------------------------------------------
113
+
114
+  // When list item is clicked, load corresponding info
115
+  $('.list-group-item').on('click', function()
116
+  {
117
+    var id = $(this).data('objective-id');
118
+
119
+    $.post(
120
+    "{{ URL::action('ObjectivesController@fetchObjectiveForCriteria') }}",
121
+    { id: id },
122
+    function(json)
123
+    {
124
+        // Retrieve datatable instance
125
+        var table = $('.datatable').DataTable();
126
+
127
+        var name = json.objective.text;
128
+        var definition = json.objective.program.name;
129
+        var criteria =json.objective.criteria;
130
+
131
+        $('#objective-display').parent().show();
132
+        $('.no-objective').parent().hide();
133
+
134
+        //Display title and definition
135
+        $('#objective-display .panel-title').html(name);
136
+        $('#objective-display .objective-definition').html(definition);
137
+
138
+        //Empty table
139
+        table.clear();
140
+
141
+        // Add new criteria
142
+        if(criteria.length>0)
143
+        {
144
+          $('table').show();
145
+          $.each(criteria, function(index, value)
146
+          {
147
+              table.row.add([
148
+                value.name,
149
+                value.description12,
150
+                value.description34,
151
+                value.description56,
152
+                value.description78
153
+              ]);
154
+          });
155
+        }
156
+        else
157
+        {
158
+          $('table').hide();
159
+        }
160
+
161
+        // Update display
162
+        table.draw();
163
+    },
164
+    'json'
165
+    );
166
+
167
+  })
168
+});
169
+
170
+@stop

+ 7
- 1
app/views/local/managers/admins/_navigation.blade.php View File

@@ -17,7 +17,13 @@
17 17
           <li>{{ HTML::linkAction('UsersController@index', 'Users') }}</li>
18 18
         </ul>
19 19
       </li>
20
-      <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li>
20
+      <li class="dropdown">
21
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
22
+        <ul class="dropdown-menu" role="menu">
23
+          <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
24
+          <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
25
+        </ul>
26
+      </li>
21 27
       <li class="dropdown">
22 28
         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Colleges and Schools<span class="caret"></span></a>
23 29
         <ul class="dropdown-menu" role="menu">

+ 7
- 5
app/views/local/managers/admins/criteria.blade.php View File

@@ -232,13 +232,14 @@
232 232
                     {{ Form::label('notes', 'Additional Notes') }}
233 233
                     {{ Form::textarea('notes', Input::old('notes'), array('class' => 'form-control', 'rows'=>2, 'id'=>'criterion_notes', 'placeholder'=>'(optional)')) }}
234 234
                 </div>
235
-                <div id='delete'>
236 235
 
237
-                </div>
236
+
238 237
                 {{ Form::submit('Update', array('class' => 'btn btn-primary btn-block')) }}
239 238
                 {{ Form::close() }}
240 239
 
241
-
240
+                {{ Form::open(array('action' => 'CriteriaController@delete')) }}
241
+                <input type='hidden' name='criterion_delete' id='deleteCriteria'>
242
+                {{Form::submit("Delete", array('class'=> 'btn btn-primary btn-block', 'id'=>"DeleteButton"))}}
242 243
             </div>
243 244
         </div>
244 245
     </div>
@@ -718,9 +719,10 @@
718 719
 
719 720
                 if (!(json.activity_criterion.length)) {
720 721
 
721
-                    var button = "<button type='button' class ='btn btn-primary btn-block' onclick ='deleteCriterion()'>Delete Criterion</button><br><br>"
722
-                    $('#delete').html(button)
722
+                    $('#DeleteButton').prop('enabled', true);
723 723
 
724
+                } else {
725
+                    $('#DeleteButton').prop('disabled', true);
724 726
                 }
725 727
 
726 728
                 if (!(json.criteria.length)) {

+ 148
- 39
app/views/local/managers/admins/objectives.blade.php View File

@@ -35,14 +35,16 @@
35 35
                 <!-- Associated Program -->
36 36
 
37 37
 
38
+                <!-- Associated Program -->
38 39
                 <div class="form-group">
39
-                    {{ Form::label('program_id', 'Associated Program') }}
40
-                    <select id="program_id" name="program_id" class="form-control selectpicker">
41
-                        <option value="0">All</option>
42
-                        @foreach ($programs as $program)
43
-                        <option value="{{ $program->id }}">{{ $program->name }} [{{ $program->school->name }}]</option>
44
-                        @endforeach
45
-                    </select>
40
+                    {{ Form::label('program_id', 'Associated Program') }}<br>
41
+                    <br>
42
+
43
+                    @foreach ($programs as $program)
44
+
45
+                    <input type="checkbox" id="{{ $program->name }}" name="program_id[]" value="{{$program->id}}">
46
+                    <label for="{{ $program->name }}"> {{ $program->name }} [{{ $program->school->name }}]</label><br>
47
+                    @endforeach
46 48
                 </div>
47 49
 
48 50
 
@@ -65,8 +67,21 @@
65 67
                 Edit
66 68
             </div>
67 69
             <div class="panel-body">
70
+
68 71
                 {{ Form::open(array('action' => 'Objective2Controller@update')) }}
72
+                <div class="form-group">
73
+                    {{ Form::label('program_id2', 'Associated Program')}}
74
+                    <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
75
+                        @foreach ($programs as $program)
76
+                        <option value='{{$program->id}}' data-subtext="{{$program->code}}">{{$program->name}}</option>
77
+                        @endforeach
78
+                    </select>
79
+                </div>
80
+                <div class="form-group">
81
+                    <label>Associated Outcome</label>
82
+                    {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
69 83
 
84
+                </div>
70 85
                 <div class="form-group">
71 86
                     {{ Form::label('objective_id', 'Objectives') }}
72 87
                     <select id="select-objective" name="id" class="form-control selectpicker">
@@ -104,16 +119,18 @@
104 119
 
105 120
 
106 121
                 <!-- Associated Program -->
122
+                <!-- Associated Program -->
107 123
                 <div class="form-group">
108
-                    {{ Form::label('program_id2', 'Associated Program') }}
109
-                    <select id="program_id2" name="program_id" class="form-control selectpicker">
110
-                        <option value="0">All</option>
111
-                        @foreach ($programs as $program)
112
-                        <option value="{{ $program->id }}">{{ $program->name }} [{{ $program->school->name }}]</option>
113
-                        @endforeach
114
-                    </select>
124
+
125
+                    {{ Form::label('program_id2', 'Associated Program') }}<br><br>
126
+                    @foreach ($programs as $program)
127
+
128
+                    <input type="checkbox" id="assoc_program_id_{{ $program->id }}" name="program_id[]" value="{{$program->id}}">
129
+                    <label for="assoc_program_id_{{ $program->id }}"> {{ $program->name }} <sub>[{{ $program->school->name }}]</sub></label><br>
130
+                    @endforeach
115 131
                 </div>
116 132
 
133
+
117 134
                 <!-- Status -->
118 135
                 <div class="form-group">
119 136
                     {{ Form::label('status', 'Status') }}
@@ -125,12 +142,20 @@
125 142
                     </select>
126 143
                 </div>
127 144
 
145
+
128 146
                 <div class="form-group">
129 147
                     {{ Form::label('text', 'Text') }}
130 148
                     {{ Form::text('text', Input::old('text'), array('class' => 'form-control', 'id'=>'objective-text')) }}
131 149
                 </div>
150
+                <div id="text">
151
+
152
+                </div>
153
+
132 154
                 {{ Form::submit('Update', array('class' => 'btn btn-primary btn-block')) }}
133 155
                 {{ Form::close() }}
156
+                <form action="/deleteObjective" method="POST" id='deleteObj'>
157
+
158
+                </form>
134 159
             </div>
135 160
 
136 161
 
@@ -142,7 +167,30 @@
142 167
 <script>
143 168
     var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
144 169
     var selectOptions = document.getElementById('outcome[0]').innerHTML;
145
-    var ran = false;
170
+    fetchAllObjectives("select-program", "assoc_outcomes_fetch")
171
+
172
+    function fetchAllObjectives(program, outcome) {
173
+        var program_id_fetch = $('#' + program).find(':selected').val();
174
+        var outcome_fetch = $('#' + outcome).find(':selected').val();
175
+        $.post(
176
+            "{{URL::action('Objective2Controller@fetchAllObjectives')}}", {
177
+                program_fetch: program_id_fetch,
178
+                outcome_fetch: outcome_fetch
179
+            },
180
+            function(json) {
181
+                json_length = (json.objective.length);
182
+                fullHTML = '';
183
+                for (var i = 0; i < json_length; i++) {
184
+                    fullHTML += '<option value="' + json.objective[i].id + '">' + json.objective[i].text + '</option>';
185
+                }
186
+                $('#select-objective').html(fullHTML);
187
+                $('#select-objective').selectpicker('refresh');
188
+                fetchObjectiveForEditing();
189
+
190
+            },
191
+            'json'
192
+        );
193
+    }
146 194
 
147 195
     var counter = 1;
148 196
     var counterAssoc = 1;
@@ -168,6 +216,8 @@
168 216
         document.getElementById("outcomeGroup").innerHTML += outcomeHTML;
169 217
     }
170 218
 
219
+
220
+
171 221
     function addOutcomeTest() {
172 222
         var $select = $('<select/>', {
173 223
             'class': "selectpicker form-control",
@@ -221,8 +271,7 @@
221 271
             },
222 272
             function(json) {
223 273
 
224
-                var text = json[0].text;
225
-
274
+                var text = json.objective[0].text;
226 275
 
227 276
 
228 277
                 // Display info
@@ -230,19 +279,15 @@
230 279
 
231 280
 
232 281
                 // Select associated outcome
233
-                var outcome_id = json[0].outcome_id;
234
-                $('#assoc_outcome0').val(outcome_id);
235
-                $('#assoc_outcome0').selectpicker('refresh');
236
-
237
-                var length = json.length;
238
-                if (ran == true) {
239
-                    for (var i = counterAssoc; i != 0; i--) {
240
-                        deleteLastAssoc(i);
282
+                for (var i = counterAssoc; i != 1; i--) {
283
+                    deleteLastAssoc(i);
241 284
 
242
-                    }
243
-                    counterAssoc = 1
244 285
                 }
245
-                for (var i = 1; i < length; i++) {
286
+                $('#assoc_outcome0').val(json.outcome[0].outcome_id);
287
+                $('#assoc_outcome0').selectpicker('refresh');
288
+                counterAssoc = 1;
289
+                for (var i = 1; i < json.outcome.length; i++) {
290
+                    counterAssoc = i + 1;
246 291
                     var $select = $('<select />', {
247 292
                         'class': "selectpicker form-control",
248 293
                         'name': "assoc_outcome[]",
@@ -273,30 +318,94 @@
273 318
                     $select.appendTo('#assocOutcomeForm' + i.toString()).selectpicker('refresh');
274 319
                     $divForButton.appendTo('#assocOutcomeGroup');
275 320
 
276
-                    $('#assoc_outcome' + i.toString()).val(json[i].outcome_id);
321
+                    $('#assoc_outcome' + i.toString()).val(json.outcome[i].outcome_id);
277 322
                     $('#assoc_outcome' + i.toString()).selectpicker('refresh');
278 323
 
279
-                    counterAssoc = i;
280
-                    ran = true;
281 324
 
282 325
                 }
283 326
 
327
+
284 328
                 // Select associated program
285
-                if (json[0].program_id) {
286
-                    $('#program_id2').val(json[0].program_id);
329
+                var program_length = json.program.length;
330
+                $('input[type=checkbox]').prop('checked', false);
287 331
 
288
-                } else {
289
-                    $('#program_id2').val(0);
332
+                for (var i = 0; i < program_length; i++) {
333
+                    prog = json.program[i].program_id.toString();
334
+                    $('#assoc_program_id_' + prog).prop("checked", true);
290 335
                 }
291 336
 
292
-                $('#program_id2').selectpicker('refresh');
293
-
294 337
 
295 338
                 // Select status
296
-                if (json[0].deleted_at)
339
+                if (json.objective[0].deleted_at)
297 340
                     $('#status').val(0);
298 341
                 else
299 342
                     $('#status').val(1);
343
+                if (json.assessment.length) {
344
+                    $('#deleteObj').html("<p>This objective is currently participating in an assessment, therefore it cannot be deleted</p>");
345
+                } else if (json.assoc_criteria.length) {
346
+                    modal = '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
347
+                        'Delete' +
348
+                        '</button>' +
349
+                        '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
350
+
351
+                        '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
352
+                        '<div class="modal-dialog" role="document">' +
353
+                        '<div class="modal-content">' +
354
+                        ' <div class="modal-header">' +
355
+                        '<h5 class="modal-title" id="exampleModalLabel">Are you sure?</h5>' +
356
+                        '<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
357
+                        '<span aria-hidden="true">&times;</span>' +
358
+                        '</button>' +
359
+                        ' </div>' +
360
+                        '<div class="modal-body">' +
361
+                        "<p>This objective is associated to: <p>" +
362
+                        '<ul>';
363
+                    for (var i = 0; i < json.assoc_criteria.length; i++) {
364
+                        modal += "<li>" + json.assoc_criteria[i].name + '</li>';
365
+                    }
366
+                    modal += ' </ul>' +
367
+                        '<p>Do you still want to delete it?</p>' +
368
+                        '</div>' +
369
+                        '<div class="modal-footer">' +
370
+                        '<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>' +
371
+                        '<button type="submit" class="btn btn-primary">Delete</button>' +
372
+                        '</div>' +
373
+                        '</div>' +
374
+                        '</div>' +
375
+                        '</div>';
376
+                    $('#deleteObj').html(modal);
377
+
378
+
379
+                } else {
380
+                    modal = '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
381
+                        'Delete' +
382
+                        '</button>' +
383
+                        '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
384
+
385
+                        '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
386
+                        '<div class="modal-dialog" role="document">' +
387
+                        '<div class="modal-content">' +
388
+                        ' <div class="modal-header">' +
389
+                        '<h5 class="modal-title" id="exampleModalLabel">Are you sure?</h5>' +
390
+                        '<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
391
+                        '<span aria-hidden="true">&times;</span>' +
392
+                        '</button>' +
393
+                        ' </div>' +
394
+                        '<div class="modal-body">' +
395
+                        "<p> Once deleted, there is no chance of getting it back.</p>";
396
+
397
+                    modal +=
398
+                        '<p>Do you still want to delete it?</p>' +
399
+                        '</div>' +
400
+                        '<div class="modal-footer">' +
401
+                        '<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>' +
402
+                        '<button type="submit" class="btn btn-primary">Delete</button>' +
403
+                        '</div>' +
404
+                        '</div>' +
405
+                        '</div>' +
406
+                        '</div>';
407
+                    $('#deleteObj').html(modal);
408
+                }
300 409
             },
301 410
             'json'
302 411
         );
@@ -346,7 +455,7 @@
346 455
         $divForButton.appendTo('#assocOutcomeGroup');
347 456
 
348 457
 
349
-        ran = true;
458
+
350 459
         counterAssoc += 1;
351 460
 
352 461
 

+ 8
- 1
app/views/local/managers/pCoords/_navigation.blade.php View File

@@ -6,9 +6,16 @@
6 6
     <ul class="nav navbar-nav navbar-right">
7 7
       <li>{{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Overview') }}</li>
8 8
       <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
9
-      <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li>
9
+
10 10
       <li>{{ HTML::linkAction('Objective2Controller@editProgram', 'Objectives')}}</li>
11 11
       <li>{{ HTML::linkAction('CriteriaController@editProgram', 'Criteria') }}</li>
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>
14
+        <ul class="dropdown-menu" role="menu">
15
+          <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
16
+          <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
17
+        </ul>
18
+      </li>
12 19
       @if(count(Auth::user()->courses))
13 20
       <li> {{ HTML::linkAction('ProfessorsController@overview', 'My Courses', NULL) }}</li>
14 21
       <li class="dropdown">

+ 97
- 34
app/views/local/managers/pCoords/objectives.blade.php View File

@@ -36,15 +36,17 @@
36 36
 
37 37
 
38 38
                 <div class="form-group">
39
-                    {{ Form::label('program_id', 'Associated Program') }}
40
-                    <select id="program_id" name="program_id" class="form-control selectpicker">
39
+                    {{ Form::label('program_id', 'Associated Program') }}<br>
40
+                    <br>
41 41
 
42
-                        <option value="{{ $programs[0]->id }}">{{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</option>
43 42
 
44
-                    </select>
45
-                </div>
43
+
44
+                    <input type="checkbox" id="{{ $programs[0]->name }}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
45
+                    <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
46 46
 
47 47
 
48
+                </div>
49
+
48 50
                 <div class="form-group">
49 51
                     {{ Form::label('text', 'Text') }}
50 52
                     {{ Form::text('text', '', array('class' => 'form-control')) }}
@@ -104,13 +106,15 @@
104 106
 
105 107
                 <!-- Associated Program -->
106 108
                 <div class="form-group">
107
-                    {{ Form::label('program_id2', 'Associated Program') }}
108
-                    <select id="program_id2" name="program_id" class="form-control selectpicker">
109
+                    {{ Form::label('program_id', 'Associated Program') }}<br>
110
+                    <br>
109 111
 
110 112
 
111
-                        <option value="{{ $programs[0]->id }}">{{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</option>
112 113
 
113
-                    </select>
114
+                    <input type="checkbox" id="{{ $programs[0]->name }}" id="assoc_program_id_{{$programs[0]->id}}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
115
+                    <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
116
+
117
+
114 118
                 </div>
115 119
 
116 120
                 <!-- Status -->
@@ -131,6 +135,9 @@
131 135
                 {{ Form::submit('Update', array('class' => 'btn btn-primary btn-block')) }}
132 136
                 {{ Form::close() }}
133 137
             </div>
138
+            <div id="text">
139
+                <p>lmao</p>
140
+            </div>
134 141
 
135 142
 
136 143
 
@@ -220,8 +227,7 @@
220 227
             },
221 228
             function(json) {
222 229
 
223
-                var text = json[0].text;
224
-
230
+                var text = json.objective[0].text;
225 231
 
226 232
 
227 233
                 // Display info
@@ -229,19 +235,15 @@
229 235
 
230 236
 
231 237
                 // Select associated outcome
232
-                var outcome_id = json[0].outcome_id;
233
-                $('#assoc_outcome0').val(outcome_id);
234
-                $('#assoc_outcome0').selectpicker('refresh');
235
-
236
-                var length = json.length;
237
-                if (ran == true) {
238
-                    for (var i = counterAssoc; i != 0; i--) {
239
-                        deleteLastAssoc(i);
238
+                for (var i = counterAssoc; i != 1; i--) {
239
+                    deleteLastAssoc(i);
240 240
 
241
-                    }
242
-                    counterAssoc = 1
243 241
                 }
244
-                for (var i = 1; i < length; i++) {
242
+                $('#assoc_outcome0').val(json.outcome[0].outcome_id);
243
+                $('#assoc_outcome0').selectpicker('refresh');
244
+                counterAssoc = 1;
245
+                for (var i = 1; i < json.outcome.length; i++) {
246
+                    counterAssoc = i + 1;
245 247
                     var $select = $('<select />', {
246 248
                         'class': "selectpicker form-control",
247 249
                         'name': "assoc_outcome[]",
@@ -272,34 +274,95 @@
272 274
                     $select.appendTo('#assocOutcomeForm' + i.toString()).selectpicker('refresh');
273 275
                     $divForButton.appendTo('#assocOutcomeGroup');
274 276
 
275
-                    $('#assoc_outcome' + i.toString()).val(json[i].outcome_id);
277
+                    $('#assoc_outcome' + i.toString()).val(json.outcome[i].outcome_id);
276 278
                     $('#assoc_outcome' + i.toString()).selectpicker('refresh');
277 279
 
278
-                    counterAssoc = i;
279
-                    ran = true;
280 280
 
281 281
                 }
282 282
 
283
-                // Select associated program
284
-                if (json[0].program_id) {
285
-                    $('#program_id2').val(json[0].program_id);
286
-
287
-                } else {
288
-                    $('#program_id2').val(0);
289
-                }
290 283
 
291
-                $('#program_id2').selectpicker('refresh');
292 284
 
293 285
 
294 286
                 // Select status
295
-                if (json[0].deleted_at)
287
+                if (json.objective[0].deleted_at)
296 288
                     $('#status').val(0);
297 289
                 else
298 290
                     $('#status').val(1);
291
+
292
+                if (json.assessment.length) {
293
+                    $('#deleteObj').html("<p>This objective is currently participating in an assessment, therefore it cannot be deleted</p>");
294
+                } else if (json.assoc_criteria.length) {
295
+                    modal = '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
296
+                        'Delete' +
297
+                        '</button>' +
298
+                        '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
299
+
300
+                        '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
301
+                        '<div class="modal-dialog" role="document">' +
302
+                        '<div class="modal-content">' +
303
+                        ' <div class="modal-header">' +
304
+                        '<h5 class="modal-title" id="exampleModalLabel">Are you sure?</h5>' +
305
+                        '<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
306
+                        '<span aria-hidden="true">&times;</span>' +
307
+                        '</button>' +
308
+                        ' </div>' +
309
+                        '<div class="modal-body">' +
310
+                        "<p>This objective is associated to: <p>" +
311
+                        '<ul>';
312
+                    for (var i = 0; i < json.assoc_criteria.length; i++) {
313
+                        modal += "<li>" + json.assoc_criteria[i].name + '</li>';
314
+                    }
315
+                    modal += ' </ul>' +
316
+                        '<p>Do you still want to delete it?</p>' +
317
+                        '</div>' +
318
+                        '<div class="modal-footer">' +
319
+                        '<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>' +
320
+                        '<button type="submit" class="btn btn-primary">Delete</button>' +
321
+                        '</div>' +
322
+                        '</div>' +
323
+                        '</div>' +
324
+                        '</div>';
325
+                    $('#deleteObj').html(modal);
326
+
327
+
328
+                } else {
329
+                    modal = '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
330
+                        'Delete' +
331
+                        '</button>' +
332
+                        '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
333
+
334
+                        '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
335
+                        '<div class="modal-dialog" role="document">' +
336
+                        '<div class="modal-content">' +
337
+                        ' <div class="modal-header">' +
338
+                        '<h5 class="modal-title" id="exampleModalLabel">Are you sure?</h5>' +
339
+                        '<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
340
+                        '<span aria-hidden="true">&times;</span>' +
341
+                        '</button>' +
342
+                        ' </div>' +
343
+                        '<div class="modal-body">' +
344
+                        "<p> Once deleted, there is no chance of getting it back.</p>";
345
+
346
+                    modal +=
347
+                        '<p>Do you still want to delete it?</p>' +
348
+                        '</div>' +
349
+                        '<div class="modal-footer">' +
350
+                        '<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>' +
351
+                        '<button type="submit" class="btn btn-primary">Delete</button>' +
352
+                        '</div>' +
353
+                        '</div>' +
354
+                        '</div>' +
355
+                        '</div>';
356
+                    $('#deleteObj').html(modal);
357
+                }
299 358
             },
300 359
             'json'
301 360
         );
302 361
     }
362
+    },
363
+    'json'
364
+    );
365
+    }
303 366
 
304 367
     function deleteLastAssoc() {
305 368
 

+ 7
- 1
app/views/local/managers/sCoords/_navigation.blade.php View File

@@ -6,7 +6,13 @@
6 6
     <ul class="nav navbar-nav navbar-right">
7 7
       <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
8 8
       <li>{{ HTML::linkAction('TemplatesController@newTemplate', 'Rubrics') }}</li>
9
-      <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li>
9
+      <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>
11
+        <ul class="dropdown-menu" role="menu">
12
+          <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
13
+          <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
14
+        </ul>
15
+      </li>
10 16
       <li>{{ HTML::linkAction('Objective2Controller@editSchool', 'Objectives')}}</li>
11 17
       <li>{{ HTML::linkAction('CriteriaController@editSchool', 'Criteria') }}</li>
12 18
       @if(count(Auth::user()->courses))

+ 103
- 38
app/views/local/managers/sCoords/objectives.blade.php View File

@@ -36,15 +36,16 @@
36 36
 
37 37
 
38 38
                 <div class="form-group">
39
-                    {{ Form::label('program_id', 'Associated Program') }}
40
-                    <select id="program_id" name="program_id" class="form-control selectpicker">
41
-                        <option value="0">All</option>
42
-                        @foreach ($programs as $program)
43
-                        <option value="{{ $program->id }}">{{ $program->name }} [{{ $program->school->name }}]</option>
44
-                        @endforeach
45
-                    </select>
46
-                </div>
39
+                    {{ Form::label('program_id', 'Associated Program') }}<br>
40
+                    <br>
41
+
42
+                    @foreach ($programs as $program)
47 43
 
44
+                    <input type="checkbox" id="{{ $program->name }}" name="program_id[]" value="{{$program->id}}">
45
+                    <label for="{{ $program->name }}"> {{ $program->name }} [{{ $program->school->name }}]</label><br>
46
+                    @endforeach
47
+
48
+                </div>
48 49
 
49 50
                 <div class="form-group">
50 51
                     {{ Form::label('text', 'Text') }}
@@ -105,15 +106,16 @@
105 106
 
106 107
                 <!-- Associated Program -->
107 108
                 <div class="form-group">
108
-                    {{ Form::label('program_id2', 'Associated Program') }}
109
-                    <select id="program_id2" name="program_id" class="form-control selectpicker">
110
-                        <option value="0">All</option>
111
-                        @foreach ($programs as $program)
112
-                        <option value="{{ $program->id }}">{{ $program->name }} [{{ $program->school->name }}]</option>
113
-                        @endforeach
114
-                    </select>
109
+
110
+                    {{ Form::label('program_id2', 'Associated Program') }}<br><br>
111
+                    @foreach ($programs as $program)
112
+
113
+                    <input type="checkbox" id="assoc_program_id_{{ $program->id }}" name="program_id[]" value="{{$program->id}}">
114
+                    <label for="assoc_program_id_{{ $program->id }}"> {{ $program->name }} <sub>[{{ $program->school->name }}]</sub></label><br>
115
+                    @endforeach
115 116
                 </div>
116 117
 
118
+
117 119
                 <!-- Status -->
118 120
                 <div class="form-group">
119 121
                     {{ Form::label('status', 'Status') }}
@@ -221,8 +223,7 @@
221 223
             },
222 224
             function(json) {
223 225
 
224
-                var text = json[0].text;
225
-
226
+                var text = json.objective[0].text;
226 227
 
227 228
 
228 229
                 // Display info
@@ -230,19 +231,15 @@
230 231
 
231 232
 
232 233
                 // Select associated outcome
233
-                var outcome_id = json[0].outcome_id;
234
-                $('#assoc_outcome0').val(outcome_id);
235
-                $('#assoc_outcome0').selectpicker('refresh');
234
+                for (var i = counterAssoc; i != 1; i--) {
235
+                    deleteLastAssoc(i);
236 236
 
237
-                var length = json.length;
238
-                if (ran == true) {
239
-                    for (var i = counterAssoc; i != 0; i--) {
240
-                        deleteLastAssoc(i);
241
-
242
-                    }
243
-                    counterAssoc = 1
244 237
                 }
245
-                for (var i = 1; i < length; i++) {
238
+                $('#assoc_outcome0').val(json.outcome[0].outcome_id);
239
+                $('#assoc_outcome0').selectpicker('refresh');
240
+                counterAssoc = 1;
241
+                for (var i = 1; i < json.outcome.length; i++) {
242
+                    counterAssoc = i + 1;
246 243
                     var $select = $('<select />', {
247 244
                         'class': "selectpicker form-control",
248 245
                         'name': "assoc_outcome[]",
@@ -273,34 +270,102 @@
273 270
                     $select.appendTo('#assocOutcomeForm' + i.toString()).selectpicker('refresh');
274 271
                     $divForButton.appendTo('#assocOutcomeGroup');
275 272
 
276
-                    $('#assoc_outcome' + i.toString()).val(json[i].outcome_id);
273
+                    $('#assoc_outcome' + i.toString()).val(json.outcome[i].outcome_id);
277 274
                     $('#assoc_outcome' + i.toString()).selectpicker('refresh');
278 275
 
279
-                    counterAssoc = i;
280
-                    ran = true;
281 276
 
282 277
                 }
283 278
 
279
+
284 280
                 // Select associated program
285
-                if (json[0].program_id) {
286
-                    $('#program_id2').val(json[0].program_id);
281
+                var program_length = json.program.length;
282
+                $('input[type=checkbox]').prop('checked', false);
287 283
 
288
-                } else {
289
-                    $('#program_id2').val(0);
284
+                for (var i = 0; i < program_length; i++) {
285
+                    prog = json.program[i].program_id.toString();
286
+                    $('#assoc_program_id_' + prog).prop("checked", true);
290 287
                 }
291 288
 
292
-                $('#program_id2').selectpicker('refresh');
293
-
294 289
 
295 290
                 // Select status
296
-                if (json[0].deleted_at)
291
+                if (json.objective[0].deleted_at)
297 292
                     $('#status').val(0);
298 293
                 else
299 294
                     $('#status').val(1);
295
+                if (json.assessment.length) {
296
+                    $('#deleteObj').html("<p>This objective is currently participating in an assessment, therefore it cannot be deleted</p>");
297
+                } else if (json.assoc_criteria.length) {
298
+                    modal = '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
299
+                        'Delete' +
300
+                        '</button>' +
301
+                        '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
302
+
303
+                        '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
304
+                        '<div class="modal-dialog" role="document">' +
305
+                        '<div class="modal-content">' +
306
+                        ' <div class="modal-header">' +
307
+                        '<h5 class="modal-title" id="exampleModalLabel">Are you sure?</h5>' +
308
+                        '<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
309
+                        '<span aria-hidden="true">&times;</span>' +
310
+                        '</button>' +
311
+                        ' </div>' +
312
+                        '<div class="modal-body">' +
313
+                        "<p>This objective is associated to: <p>" +
314
+                        '<ul>';
315
+                    for (var i = 0; i < json.assoc_criteria.length; i++) {
316
+                        modal += "<li>" + json.assoc_criteria[i].name + '</li>';
317
+                    }
318
+                    modal += ' </ul>' +
319
+                        '<p>Do you still want to delete it?</p>' +
320
+                        '</div>' +
321
+                        '<div class="modal-footer">' +
322
+                        '<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>' +
323
+                        '<button type="submit" class="btn btn-primary">Delete</button>' +
324
+                        '</div>' +
325
+                        '</div>' +
326
+                        '</div>' +
327
+                        '</div>';
328
+                    $('#deleteObj').html(modal);
329
+
330
+
331
+                } else {
332
+                    modal = '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
333
+                        'Delete' +
334
+                        '</button>' +
335
+                        '<input type="hidden" value =' + json.objective[0].id + ' name="deleteObj">' +
336
+
337
+                        '<div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">' +
338
+                        '<div class="modal-dialog" role="document">' +
339
+                        '<div class="modal-content">' +
340
+                        ' <div class="modal-header">' +
341
+                        '<h5 class="modal-title" id="exampleModalLabel">Are you sure?</h5>' +
342
+                        '<button type="button" class="close" data-dismiss="modal" aria-label="Close">' +
343
+                        '<span aria-hidden="true">&times;</span>' +
344
+                        '</button>' +
345
+                        ' </div>' +
346
+                        '<div class="modal-body">' +
347
+                        "<p> Once deleted, there is no chance of getting it back.</p>";
348
+
349
+                    modal +=
350
+                        '<p>Do you still want to delete it?</p>' +
351
+                        '</div>' +
352
+                        '<div class="modal-footer">' +
353
+                        '<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>' +
354
+                        '<button type="submit" class="btn btn-primary">Delete</button>' +
355
+                        '</div>' +
356
+                        '</div>' +
357
+                        '</div>' +
358
+                        '</div>';
359
+                    $('#deleteObj').html(modal);
360
+                }
300 361
             },
301 362
             'json'
302 363
         );
303 364
     }
365
+    },
366
+    'json'
367
+    );
368
+    }
304 369
 
305 370
     function deleteLastAssoc() {
306 371
 

+ 239
- 228
app/views/local/managers/shared/program.blade.php View File

@@ -1,13 +1,13 @@
1 1
 @extends('layouts.master')
2 2
 
3 3
 @section('navigation')
4
-    @if($role==1)
5
-        @include('local.managers.admins._navigation')
6
-    @elseif($role==2)
7
-        @include('local.managers.sCoords._navigation')
8
-    @elseif($role==3)
9
-        @include('local.managers.pCoords._navigation')
10
-    @endif
4
+@if($role==1)
5
+@include('local.managers.admins._navigation')
6
+@elseif($role==2)
7
+@include('local.managers.sCoords._navigation')
8
+@elseif($role==3)
9
+@include('local.managers.pCoords._navigation')
10
+@endif
11 11
 @stop
12 12
 
13 13
 @section('main')
@@ -36,42 +36,44 @@
36 36
                 <div class="col-md-12">
37 37
                     <h3>Courses in this program</h3>
38 38
                     @if($program_courses->count()>0)
39
-                        <table class="table table-striped table-condensed datatable">
40
-                            <thead>
41
-                                <tr>
42
-                                    <th>Identifier</th>
43
-                                    <th>Name</th>
44
-                                    <th>Program</th>
45
-                                    <th>Assessed</th>
46
-                                </tr>
47
-                            </thead>
48
-                            <tfoot>
49
-                                <tr class="column-search">
50
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
51
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
52
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
53
-                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
54
-                                </tr>
55
-                            </tfoot>
56
-                            <tbody>
57
-                                @foreach($grouped_courses as $grouped_course)
58
-                                    <tr>
59
-                                        <td class="col-md-1">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
60
-                                        <td class="col-md-4">{{{ $grouped_course->name}}}</td>
61
-                                        <td class="col-md-3">{{{ $grouped_course->program->name }}}</td>
62
-                                        <td class="col-md-1">
63
-                                            @if($grouped_course->outcomes_attempted!=NULL)
64
-                                                Yes
65
-                                            @else
66
-                                                No
67
-                                            @endif
68
-                                        </td>
69
-                                    </tr>
70
-                                @endforeach
71
-                            </tbody>
72
-                        </table>
39
+                    <table class="table table-striped table-condensed datatable">
40
+                        <thead>
41
+                            <tr>
42
+                                <th>Identifier</th>
43
+                                <th>Name</th>
44
+                                <th>Program</th>
45
+                                <th>Assessed</th>
46
+                            </tr>
47
+                        </thead>
48
+                        <tfoot>
49
+                            <tr class="column-search">
50
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search" /></th>
51
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search" /></th>
52
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search" /></th>
53
+                                <th><select class="column-search-select form-control">
54
+                                        <option value=""></option>
55
+                                    </select></th>
56
+                            </tr>
57
+                        </tfoot>
58
+                        <tbody>
59
+                            @foreach($grouped_courses as $grouped_course)
60
+                            <tr>
61
+                                <td class="col-md-1">{{ HTML::linkAction('CoursesController@showGrouped', $grouped_course->code.$grouped_course->number.' ('.$grouped_course->semester->code.')', array($grouped_course->code, $grouped_course->number, $grouped_course->semester->code)) }}</td>
62
+                                <td class="col-md-4">{{{ $grouped_course->name}}}</td>
63
+                                <td class="col-md-3">{{{ $grouped_course->program->name }}}</td>
64
+                                <td class="col-md-1">
65
+                                    @if($grouped_course->outcomes_attempted!=NULL)
66
+                                    Yes
67
+                                    @else
68
+                                    No
69
+                                    @endif
70
+                                </td>
71
+                            </tr>
72
+                            @endforeach
73
+                        </tbody>
74
+                    </table>
73 75
                     @else
74
-                        <p class="lead"> No courses assigned.</p>
76
+                    <p class="lead"> No courses assigned.</p>
75 77
                     @endif
76 78
                 </div>
77 79
             </div>
@@ -82,43 +84,45 @@
82 84
                 <div class="col-md-12">
83 85
                     <h3>Sections in this program</h3>
84 86
                     @if($program_courses->count()>0)
85
-                        <p class="lead"> {{{ $assessed_courses_count }}} out of {{{ $program_courses->count() }}} section(s) doing Assessment ({{{ round($assessed_courses_count/$program_courses->count()*100, 2) }}}%)</p>
86
-                        <table class="table table-striped table-condensed datatable">
87
-                            <thead>
88
-                                <tr>
89
-                                    <th>Identifier</th>
90
-                                    <th>Name</th>
91
-                                    <th>Professor</th>
92
-                                    <th>Assessed</th>
93
-                                </tr>
94
-                            </thead>
95
-                            <tfoot>
96
-                                <tr class="column-search">
97
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
98
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
99
-                                    <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
100
-                                    <th><select class="column-search-select form-control"><option value=""></option></select></th>
101
-                                </tr>
102
-                            </tfoot>
103
-                            <tbody>
104
-                                @foreach($program_courses as $course)
105
-                                <tr>
106
-                                    <td>{{ HTML::linkAction('CoursesController@showLimited', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</td>
107
-                                    <td>{{{ $course->name}}}</td>
108
-                                    <td>{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
109
-                                    <td>
110
-                                        @if($course->outcomes_attempted!=NULL)
111
-                                            Yes
112
-                                        @else
113
-                                            No
114
-                                        @endif
115
-                                    </td>
116
-                                </tr>
117
-                                @endforeach
118
-                            </tbody>
119
-                        </table>
87
+                    <p class="lead"> {{{ $assessed_courses_count }}} out of {{{ $program_courses->count() }}} section(s) doing Assessment ({{{ round($assessed_courses_count/$program_courses->count()*100, 2) }}}%)</p>
88
+                    <table class="table table-striped table-condensed datatable">
89
+                        <thead>
90
+                            <tr>
91
+                                <th>Identifier</th>
92
+                                <th>Name</th>
93
+                                <th>Professor</th>
94
+                                <th>Assessed</th>
95
+                            </tr>
96
+                        </thead>
97
+                        <tfoot>
98
+                            <tr class="column-search">
99
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Buscar" /></th>
100
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Buscar" /></th>
101
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Buscar" /></th>
102
+                                <th><select class="column-search-select form-control">
103
+                                        <option value=""></option>
104
+                                    </select></th>
105
+                            </tr>
106
+                        </tfoot>
107
+                        <tbody>
108
+                            @foreach($program_courses as $course)
109
+                            <tr>
110
+                                <td>{{ HTML::linkAction('CoursesController@showLimited', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</td>
111
+                                <td>{{{ $course->name}}}</td>
112
+                                <td>{{{ $course->user->surnames }}}, {{{ $course->user->first_name }}}</td>
113
+                                <td>
114
+                                    @if($course->outcomes_attempted!=NULL)
115
+                                    Yes
116
+                                    @else
117
+                                    No
118
+                                    @endif
119
+                                </td>
120
+                            </tr>
121
+                            @endforeach
122
+                        </tbody>
123
+                    </table>
120 124
                     @else
121
-                        <p class="lead"> No sections assigned.</p>
125
+                    <p class="lead"> No sections assigned.</p>
122 126
                     @endif
123 127
                 </div>
124 128
             </div>
@@ -140,55 +144,59 @@
140 144
                         </thead>
141 145
                         <tfoot>
142 146
                             <tr class="column-search">
143
-                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
144
-                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
145
-                                <th><select class="column-search-select form-control"><option value=""></option></select></th>
146
-                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
147
-                                <th><input class="column-search-bar form-control" type="text" placeholder="Search"/></th>
147
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search" /></th>
148
+                                <th><select class="column-search-select form-control">
149
+                                        <option value=""></option>
150
+                                    </select></th>
151
+                                <th><select class="column-search-select form-control">
152
+                                        <option value=""></option>
153
+                                    </select></th>
154
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search" /></th>
155
+                                <th><input class="column-search-bar form-control" type="text" placeholder="Search" /></th>
148 156
                             </tr>
149 157
                         </tfoot>
150 158
                         <tbody>
151 159
                             @foreach($users as $user)
152
-                                <tr>
153
-                                    <td>{{ $user->surnames }}, {{ $user->first_name }}</td>
160
+                            <tr>
161
+                                <td>{{ $user->surnames }}, {{ $user->first_name }}</td>
154 162
 
155
-                                    @if($user->role == 1)
156
-                                        <td>Administrator</td>
157
-                                        <td>All</td>
158
-                                    @elseif($user->role == 2)
159
-                                        <td>School Coordinator</td>
160
-                                        <td>All in {{ $program->school->name }}</td>
161
-                                    @elseif($user->role == 3)
162
-                                        <td>Program Coordinator</td>
163
-                                        <td>
164
-                                            @foreach ($user->programs as $program)
165
-                                                {{ $program->name }}&nbsp;
166
-                                            @endforeach
167
-                                        </td>
168
-                                    @else
169
-                                        <td>Professor</td>
170
-                                        <td>
171
-                                            @foreach ($user->programs as $program)
172
-                                                {{ $program->name }}&nbsp;
173
-                                            @endforeach
174
-                                        </td>
175
-                                    @endif
163
+                                @if($user->role == 1)
164
+                                <td>Administrator</td>
165
+                                <td>All</td>
166
+                                @elseif($user->role == 2)
167
+                                <td>School Coordinator</td>
168
+                                <td>All in {{ $program->school->name }}</td>
169
+                                @elseif($user->role == 3)
170
+                                <td>Program Coordinator</td>
171
+                                <td>
172
+                                    @foreach ($user->programs as $program)
173
+                                    {{ $program->name }}&nbsp;
174
+                                    @endforeach
175
+                                </td>
176
+                                @else
177
+                                <td>Professor</td>
178
+                                <td>
179
+                                    @foreach ($user->programs as $program)
180
+                                    {{ $program->name }}&nbsp;
181
+                                    @endforeach
182
+                                </td>
183
+                                @endif
176 184
 
177
-                                    <td>
178
-                                        <a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
179
-                                    </td>
180
-                                    <td>
181
-                                        @if($user->office_phone)
182
-                                            {{{ $user->office_phone }}}
185
+                                <td>
186
+                                    <a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
187
+                                </td>
188
+                                <td>
189
+                                    @if($user->office_phone)
190
+                                    {{{ $user->office_phone }}}
183 191
 
184
-                                            @if($user->office_extension)
185
-                                                <span>ext.</span> {{{ $user->office_extension }}}
186
-                                            @endif
187
-                                        @else
188
-                                            Not set
189
-                                        @endif
190
-                                    </td>
191
-                                </tr>
192
+                                    @if($user->office_extension)
193
+                                    <span>ext.</span> {{{ $user->office_extension }}}
194
+                                    @endif
195
+                                    @else
196
+                                    Not set
197
+                                    @endif
198
+                                </td>
199
+                            </tr>
192 200
                             @endforeach
193 201
                         </tbody>
194 202
                     </table>
@@ -215,121 +223,124 @@
215 223
 @section('javascript')
216 224
 
217 225
 $('#programTabs a').click(function (e) {
218
-    e.preventDefault()
219
-    $(this).tab('show');
226
+e.preventDefault()
227
+$(this).tab('show');
220 228
 });
221 229
 
222 230
 
223 231
 $('#graph').highcharts({
224
-    chart: {
225
-        type: 'bar'
226
-    },
227
-    title: {
228
-        text: 'Performance by Learning Outcome Criteria in {{ $program->name }} Program'
229
-    },
230
-    legend: {
231
-                reversed: true,
232
-            },
233
-    xAxis: {
234
-        categories: [
235
-            @foreach($outcomes as $outcome)
236
-                "{{{ $outcome->name }}}",
237
-            @endforeach
238
-        ],
239
-        labels: {
240
-            style: {
241
-                fontSize:'11px'
242
-            },
243
-            step:1,
244
-            useHTML:true,
245
-            formatter: function() {
246
-                return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
247
-            },
248
-        }
249
-    },
250
-    yAxis: {
251
-        min: 0,
252
-        max: 100,
253
-        title: {
254
-            text: 'Percentage'
255
-        }
256
-    },
257
-    tooltip: {
258
-        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
259
-        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
260
-            '<td style="padding:0"><b>{point.y:.2f}</b></td></tr>',
261
-        footerFormat: '</table>',
262
-        shared: true,
263
-        useHTML: true
264
-    },
265
-    plotOptions: {
266
-        bar: {
267
-            //grouping: false,
268
-            shadow: false,
269
-            borderWidth: 0,
270
-        },
271
-        series: {
272
-        pointPadding: 0,
273
-        groupPadding: 0.075
274
-        },
275
-    },
276
-    series: [{
277
-        name: 'Expected Value',
278
-        color: '#555555',
279
-        dataLabels: {
280
-            enabled: true,
281
-            fontSize: 8,
282
-            color: '#fff',
283
-            align: 'right',
284
-            format: '{y:.1f}%',
285
-            style: {
286
-                //fontWeight: 'bold'
287
-            },
288
-            y:-1
289
-        },
290
-        data: [
291
-            @foreach($outcomes as $index => $outcome)
292
-                @if(
293
-                    is_array($outcomes_attempted)
294
-                    && array_key_exists($outcome->id, $outcomes_attempted)
295
-                    && $outcomes_attempted[$outcome->id]!=0)
296
-                    {{{ $outcome->expected_outcome }}},
297
-                @else
298
-                    0,
299
-                @endif
300
-            @endforeach
301
-        ]
232
+chart: {
233
+type: 'bar'
234
+},
235
+title: {
236
+text: 'Performance by Learning Outcome Criteria in {{ $program->name }} Program'
237
+},
238
+legend: {
239
+reversed: true,
240
+},
241
+xAxis: {
242
+categories: [
243
+@foreach($outcomes as $outcome)
244
+"{{{ $outcome->name }}}",
245
+@endforeach
246
+],
247
+labels: {
248
+style: {
249
+fontSize:'11px'
250
+},
251
+step:1,
252
+useHTML:true,
253
+formatter: function() {
254
+return '<div style="width:200px; word-break:break; text-overflow:ellipsis; overflow:hidden;">'+this.value+'</div>';
255
+},
256
+}
257
+},
258
+yAxis: {
259
+min: 0,
260
+max: 100,
261
+title: {
262
+text: 'Percentage'
263
+}
264
+},
265
+tooltip: {
266
+headerFormat: '<span style="font-size:10px">{point.key}</span>
267
+<table>',
268
+    pointFormat: '<tr>
269
+        <td style="color:{series.color};padding : 0">{series.name}: </td>' +
270
+        '<td style="padding:0"><b>{point.y:.2f}</b></td>
271
+    </tr>',
272
+    footerFormat: '</table>',
273
+shared: true,
274
+useHTML: true
275
+},
276
+plotOptions: {
277
+bar: {
278
+//grouping: false,
279
+shadow: false,
280
+borderWidth: 0,
281
+},
282
+series: {
283
+pointPadding: 0,
284
+groupPadding: 0.075
285
+},
286
+},
287
+series: [{
288
+name: 'Expected Value',
289
+color: '#555555',
290
+dataLabels: {
291
+enabled: true,
292
+fontSize: 8,
293
+color: '#fff',
294
+align: 'right',
295
+format: '{y:.1f}%',
296
+style: {
297
+//fontWeight: 'bold'
298
+},
299
+y:-1
300
+},
301
+data: [
302
+@foreach($outcomes as $index => $outcome)
303
+@if(
304
+is_array($outcomes_attempted)
305
+&& array_key_exists($outcome->id, $outcomes_attempted)
306
+&& $outcomes_attempted[$outcome->id]!=0)
307
+{{{ $outcome->expected_outcome }}},
308
+@else
309
+0,
310
+@endif
311
+@endforeach
312
+]
302 313
 
303
-    },{
304
-        name: 'Obtained Value',
305
-        color: '#e70033',
306
-        dataLabels: {
307
-            enabled: true,
308
-            fontSize: 8,
309
-            color: '#fff',
310
-            align: 'right',
311
-            format: '{y:.1f}%',
312
-            style: {
313
-                //fontWeight: 'bold'
314
-            },
315
-            y:-1
316
-        },
317
-        data:[
318
-            @foreach($outcomes as $index => $outcome)
319
-                @if(
320
-                    is_array($outcomes_attempted)
321
-                    && array_key_exists($outcome->id, $outcomes_attempted)
322
-                    && $outcomes_attempted[$outcome->id]!=0)
323
-                    {{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
324
-                @else
325
-                    0,
326
-                @endif
327
-            @endforeach
328
-        ]
329
-    }]
314
+},{
315
+name: 'Obtained Value',
316
+color: '#e70033',
317
+dataLabels: {
318
+enabled: true,
319
+fontSize: 8,
320
+color: '#fff',
321
+align: 'right',
322
+format: '{y:.1f}%',
323
+style: {
324
+//fontWeight: 'bold'
325
+},
326
+y:-1
327
+},
328
+data:[
329
+@foreach($outcomes as $index => $outcome)
330
+@if(
331
+is_array($outcomes_attempted)
332
+&& array_key_exists($outcome->id, $outcomes_attempted)
333
+&& $outcomes_attempted[$outcome->id]!=0)
334
+{{{ ($outcomes_achieved[$outcome->id]/$outcomes_attempted[$outcome->id])*100 }}},
335
+@else
336
+0,
337
+@endif
338
+@endforeach
339
+]
340
+}]
330 341
 });
331 342
 
332 343
 // Include dummy graph for outcomes
333 344
 @include('global.dummy-outcomes')
334 345
 
335
-@stop
346
+@stop

+ 303
- 0
app/views/local/managers/shared/program_report.blade.php
File diff suppressed because it is too large
View File


+ 95
- 1
app/views/local/managers/shared/programs.blade.php View File

@@ -11,6 +11,76 @@
11 11
 @stop
12 12
 
13 13
 @section('main')
14
+  <button class="btn btn-lg btn-primary pull-right" id='show'>Custom Report</button>
15
+  <div class="" id='make_report'>
16
+    <hr>
17
+    <b><h3>Report Options</h3><br></b>
18
+    {{-- For for adding a new outcome --}}
19
+    {{ Form::open(array('action' => 'ProgramsController@showReport')) }}
20
+    <div class="row">
21
+      <div class="col-md-1">
22
+      </div>
23
+      <div class="col-md-5">
24
+      {{ Form::label('name', 'Select which semesters to report on') }}<br>
25
+          @foreach ($semesters as $semester)
26
+            @if ($semester->is_visible)
27
+              <div class="form-group">
28
+                <input type="checkbox" id="semester{{$semester->id}}" name="semester{{$semester->id}}" value="semester{{$semester->id}}">
29
+                <label for="semester{{$semester->id}}">{{$semester->name}}({{$semester->code}})</label>
30
+                {{-- {{ Form::checkbox('semester'.$semester->id, $semester->name, array('class' => 'form-control', 'id'=>$semester->id)) }}
31
+                {{ Form::label('semester'.$semester->id, $semester->name.'('.$semester->code.')') }}<br> --}}
32
+              </div>
33
+            @endif
34
+          @endforeach
35
+      </div>
36
+      <div class="col-md-6">
37
+        {{ Form::label('divulgacion', 'Select metodos de divulgacion') }}<br>
38
+        <div class="form-group">
39
+          <input type="checkbox" id="profesores" name="profesores" value="Profesores (pares)">
40
+          <label for="profesores">Profesores (pares)</label>
41
+        </div>
42
+        <div class="form-group">
43
+          <input type="checkbox" id="comiteDepartamental" name="comiteDepartamental" value="Comites de curriculo departamental">
44
+          <label for="comiteDepartamental">Comites de curriculo departamental</label>
45
+        </div>
46
+        <div class="form-group">
47
+          <input type="checkbox" id="comiteFacultadEscuela" name="comiteFacultadEscuela" value="Comites de curriculo  de Facultad o Escuela">
48
+          <label for="comiteFacultadEscuela">Comites de curriculo  de Facultad o Escuela</label>
49
+        </div>
50
+        <div class="form-group">
51
+          <input type="checkbox" id="pleno" name="pleno" value="Pleno de la Facultad">
52
+          <label for="pleno">Pleno de la Facultad</label>
53
+        </div>
54
+        <div class="form-group">
55
+          <input type="checkbox" id="estudiantes" name="estudiantes" value="Estudiantes">
56
+          <label for="estudiantes">Estudiantes</label>
57
+        </div>
58
+        <div class="form-group">
59
+          <input type="checkbox" id="administrativos" name="administrativos" value="Administrativos">
60
+          <label for="administrativos">Administrativos</label>
61
+        </div>
62
+        <div class="form-group">
63
+          <input type="checkbox" id="senado" name="senado" value="Senado">
64
+          <label for="senado">Senado</label>
65
+        </div>
66
+        <div class="form-group">
67
+          <input type="checkbox" id="comunidadWeb" name="comunidadWeb" value="Comunidad (pagina web)">
68
+          <label for="comunidadWeb">Comunidad (pagina web)</label>
69
+        </div>
70
+        <div class="form-group">
71
+          <input type="checkbox" id="otros" name="otros" value="Otros">
72
+          <label for="otros">Otro- <input type="text" id='otherBox'></label>
73
+        </div>
74
+      </div>
75
+    </div>
76
+    <div class="row">
77
+      <div class=""><button type="submit" id='submit' class="btn btn-lg btn-primary center-block">Create Report</button></div>
78
+    </div>
79
+    {{ Form::close() }}
80
+    <hr>
81
+    <button class="btn btn-lg btn-primary pull-right" id='hide'>Hide Form</button>
82
+  </div>
83
+
14 84
 <div class="row">
15 85
   <div class="col-md-12">
16 86
       <table class="table table-condensed table-stripedd datatable">
@@ -46,4 +116,28 @@
46 116
 <!-- Datatables -->
47 117
 @include('global._datatables_js')
48 118
 
49
-@stop
119
+@stop
120
+
121
+@section('javascript')
122
+
123
+      $('#make_report').hide();
124
+
125
+      //show form
126
+      $('#show').on('click', function(e)
127
+      {
128
+        $('#make_report').show();
129
+        $('#show').hide();
130
+      });
131
+
132
+      //hide form
133
+      $('#hide').on('click', function(e)
134
+      {
135
+        $('#make_report').hide();
136
+        $('#show').show();
137
+      });
138
+
139
+      //on submit, change value of the checkbox input of id 'other'
140
+      $('#submit').click(function(){
141
+        $('#otros').val('Otro- '+$('#otherBox').val());
142
+      });
143
+@stop

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

@@ -6,16 +6,24 @@
6 6
     </div>-->
7 7
     <ul class="nav navbar-nav navbar-right">
8 8
       <li>{{ HTML::linkAction('ProfessorsController@overview', 'My Courses') }}</li>
9
-      <li>{{ HTML::linkAction('CriteriaController@index', 'Learning Outcomes and Criteria') }}</li>
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> --}}
11
+      <li class="dropdown">
12
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Learning and Criterias<span class="caret"></span></a>
13
+        <ul class="dropdown-menu" role="menu">
14
+          <li>{{ HTML::linkAction('CriteriaController@index', 'Outcomes and Criteria') }}</li>
15
+          <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'Objectives and Criteria') }}</li>
16
+        </ul>
17
+      </li>
10 18
       @if(count(Auth::user()->courses))
11
-        <li class="dropdown">
12
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Sections<span class="caret"></span></a>
13
-          <ul class="dropdown-menu" role="menu">
19
+      <li class="dropdown">
20
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Sections<span class="caret"></span></a>
21
+        <ul class="dropdown-menu" role="menu">
14 22
           @foreach ($courses as $course)
15
-            <li> {{ HTML::linkAction('CoursesController@show', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</li>
23
+          <li> {{ HTML::linkAction('CoursesController@show', $course->code.$course->number.'-'.$course->section.' ('.$course->semester->code.')', array('id'=>$course->id)) }}</li>
16 24
           @endforeach
17
-          </ul>
18
-        </li>
25
+        </ul>
26
+      </li>
19 27
       @endif
20 28
       <li> {{ HTML::linkAction('ProfessorsController@program', 'Program') }}</li>
21 29
       <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReports', 'Reports') }}</li>
@@ -37,4 +45,4 @@
37 45
       </li>
38 46
     </ul>
39 47
   </div>
40
-</div>
48
+</div>

BIN
trabajoRealizado. primer semestre 2020-2021.pdf View File