Переглянути джерело

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

Objetivos
Carlos J Corrada Bravo 2 роки тому
джерело
коміт
08d2252c54
28 змінених файлів з 858 додано та 255 видалено
  1. 101
    0
      app/controllers/AnnualPlansController.php
  2. 16
    11
      app/controllers/CriteriaController.php
  3. 40
    1
      app/controllers/Objective2Controller.php
  4. 10
    5
      app/controllers/ObjectivesController.php
  5. 78
    134
      app/controllers/OutcomesController.php
  6. 9
    9
      app/controllers/ProgramsController.php
  7. 25
    4
      app/controllers/TemplatesController.php
  8. 88
    2
      app/controllers/ThreeYearPlanController.php
  9. 2
    2
      app/models/Criterion.php
  10. 15
    0
      app/routes.php
  11. 77
    5
      app/views/global/view-objectives-criteria.blade.php
  12. 211
    3
      app/views/global/view-three-year-plan.blade.php
  13. 6
    4
      app/views/local/managers/admins/assign_other_programs.blade.php
  14. 6
    6
      app/views/local/managers/admins/overview2.blade.php
  15. 1
    1
      app/views/local/managers/admins/show-typ-program.blade.php
  16. 10
    10
      app/views/local/managers/admins/transformativeAction.blade.php
  17. 101
    1
      app/views/local/managers/shared/annual-plans.blade.php
  18. 6
    3
      app/views/local/managers/shared/annual_report.blade.php
  19. 11
    11
      app/views/local/managers/shared/course_edit.blade.php
  20. 9
    9
      app/views/local/managers/shared/criteria.blade.php
  21. 6
    5
      app/views/local/managers/shared/objectives.blade.php
  22. 10
    10
      app/views/local/managers/shared/rubrics.blade.php
  23. 10
    10
      app/views/local/managers/shared/rubrics_new.blade.php
  24. 1
    1
      app/views/local/managers/shared/view-annual-plans.blade.php
  25. 3
    3
      app/views/local/managers/shared/view_formative.blade.php
  26. 2
    1
      app/views/local/professors/activity.blade.php
  27. 2
    2
      app/views/local/professors/course.blade.php
  28. 2
    2
      app/views/local/professors/rubrics.blade.php

+ 101
- 0
app/controllers/AnnualPlansController.php Переглянути файл

@@ -246,6 +246,9 @@ class AnnualPlansController extends \BaseController
246 246
     return View::make('local.managers.shared.annual-plans', compact('title', 'annual_plans', 'current_typ', 'program', 'outcomes', 'allSemesterOrder', 'alltyp'));
247 247
   }
248 248
 
249
+
250
+
251
+
249 252
   public function fetchInfo()
250 253
   {
251 254
     //     Log::info(Input::get('id'));
@@ -1405,4 +1408,102 @@ class AnnualPlansController extends \BaseController
1405 1408
 
1406 1409
     return '200';
1407 1410
   }
1411
+
1412
+
1413
+  //feature de import rubric
1414
+
1415
+  function fetchTemplatesForCriteria()
1416
+  {
1417
+    $outcome_id = Input::get("outcome_id");
1418
+    $objective_id = Input::get('objective_id');
1419
+    $program_id = Input::get("program_id");
1420
+    $program = Program::find($program_id);
1421
+
1422
+    $criteria_list = DB::table("program_criterion_objective_outcome as poco")
1423
+      ->join('criterion_objective_outcome as cobo', 'cobo.id', '=', 'poco.cri_obj_out_id')
1424
+      ->where('program_id', $program_id)
1425
+      ->where('objective_id', $objective_id)
1426
+      ->where('outcome_id', $outcome_id)
1427
+      ->lists('criterion_id');
1428
+
1429
+    $templates = Template::join('template_criterion', 'templates.id', '=', 'template_criterion.template_id')
1430
+      //where are available for this program
1431
+      ->where(function ($q) use ($program) {
1432
+
1433
+        //donde sean rubricas de mi programa
1434
+        $q->where(function ($q2) use ($program) {
1435
+          $q2->where('school_id', $program->school->id)
1436
+            ->where('program_id', $program->id);
1437
+        })
1438
+          //o sean exclusivamente de toda la escuela
1439
+          ->orWhere(function ($q2) use ($program) {
1440
+            $q2->where('school_id', $program->school->id)
1441
+              ->whereNull('program_id');
1442
+          })
1443
+          //o de todos
1444
+          ->orWhereNull("school_id");
1445
+      })
1446
+      ->whereIn('template_criterion.criterion_id', $criteria_list)
1447
+      ->groupBy('templates.id')
1448
+      ->select('templates.*')
1449
+      ->get();
1450
+
1451
+    return $templates;
1452
+  }
1453
+
1454
+  public function pairCriteriaFromTemplate()
1455
+  {
1456
+    $typ_objective_id = Input::get('typ_objective_id');
1457
+    $template_id = Input::get("template_id");
1458
+
1459
+    $objective_id = Input::get('objective_id');
1460
+    $program_id = Input::get('program_id');
1461
+    $outcome_id = Input::get("outcome_id");
1462
+    $annual_plan = Input::get('annual_plan');
1463
+
1464
+    $list_criterion = DB::table('template_criterion')
1465
+      ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'template_criterion.criterion_id')
1466
+      ->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
1467
+      ->where('program_id', $program_id)
1468
+      ->where('cobo.outcome_id', $outcome_id)
1469
+      ->where('cobo.objective_id', $objective_id)
1470
+      ->where('template_id', $template_id)
1471
+      ->groupBy('cobo.criterion_id')
1472
+      ->select('cobo.criterion_id')
1473
+      ->lists('criterion_id');
1474
+
1475
+    Log::info($list_criterion);
1476
+
1477
+    $courses = DB::table('typ_semester_courses')
1478
+      ->where('typ_semester_objective_id', $typ_objective_id)
1479
+      ->lists('id');
1480
+    Log::info($courses);
1481
+
1482
+    //$insertable_array = [];
1483
+
1484
+    foreach ($list_criterion as $index => $criterion_id) {
1485
+      foreach ($courses as $ind => $typ_course_id) {
1486
+
1487
+        $existing = DB::table("annual_plan_objective")
1488
+          ->where('criteria_id', $criterion_id)
1489
+          ->where('annual_plan_id', $annual_plan)
1490
+          ->where('typ_semester_course_id', $typ_course_id)
1491
+          ->first();
1492
+
1493
+        if (isset($existing)) {
1494
+          Log::info('existe');
1495
+          Log::info(array($existing));
1496
+          continue;
1497
+        }
1498
+
1499
+        DB::table('annual_plan_objective')
1500
+          ->insert(array(
1501
+            'criteria_id' => $criterion_id,
1502
+            'annual_plan_id' => $annual_plan,
1503
+            'typ_semester_course_id' => $typ_course_id
1504
+          ));
1505
+      }
1506
+    }
1507
+    return 200;
1508
+  }
1408 1509
 }

+ 16
- 11
app/controllers/CriteriaController.php Переглянути файл

@@ -257,7 +257,11 @@ class CriteriaController extends \BaseController
257 257
             ->where('criterion_id', $criteria_id)
258 258
             ->orderBy('position')
259 259
             ->get();
260
-        $criterion->program =  DB::table('program_criterion')->where('criterion_id', $criteria_id)->get();
260
+        $criterion->program =  DB::table('program_criterion_objective_outcome as poco')
261
+            ->join('criterion_objective_outcome as cobo', 'cobo.id', '=', 'poco.cri_obj_out_id')
262
+            ->where('criterion_id', $criteria_id)
263
+            ->select('poco.program_id')
264
+            ->distinct()->get();
261 265
         $criterion->activity_criterion = DB::table('assessments')
262 266
             ->join('activity_criterion', 'activity_criterion.id', '=', 'assessments.activity_criterion_id')
263 267
             ->where('activity_criterion.criterion_id', $criteria_id)
@@ -336,8 +340,9 @@ class CriteriaController extends \BaseController
336 340
 
337 341
 
338 342
         $saved_criterion = DB::table('criteria')
339
-            ->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
340 343
             ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
344
+            ->join('program_criterion_objective_outcome', 'program_criterion_objective_outcome.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
345
+
341 346
             ->join('criterion_scale', 'criterion_scale.criterion_id', '=', 'criteria.id')
342 347
             ->whereIn('program_id', $input['program_id'])
343 348
             ->whereIn('objective_id', $objectives)
@@ -461,7 +466,7 @@ class CriteriaController extends \BaseController
461 466
      */
462 467
     public function create()
463 468
     {
464
-        $clean_input = $this->cleanInput();	
469
+        $clean_input = $this->cleanInput();
465 470
 
466 471
         Log::info(json_encode($clean_input));
467 472
 
@@ -489,7 +494,7 @@ class CriteriaController extends \BaseController
489 494
                     return Redirect::to('criteria')->withInput();
490 495
 
491 496
                 case 2:
492
-//                     Log::info(Input::all());
497
+                    //                     Log::info(Input::all());
493 498
                     return Redirect::to('school-criteria')->withInput();
494 499
 
495 500
                 case 3:
@@ -630,9 +635,9 @@ class CriteriaController extends \BaseController
630 635
                 }*/
631 636
 
632 637
 
633
-                foreach ($clean_input['program_id'] as $program_id) {
634
-                    DB::insert("insert into `program_criterion` (`criterion_id`, `program_id`) values({$criterionId},{$program_id})");
635
-                }
638
+                //foreach ($clean_input['program_id'] as $program_id) {
639
+                //    DB::insert("insert into `program_criterion` (`criterion_id`, `program_id`) values({$criterionId},{$program_id})");
640
+                //}
636 641
 
637 642
                 Session::flash('status', 'success');
638 643
                 Session::flash('message', 'Criterion created: "' . $criterion->name . '".');
@@ -873,7 +878,7 @@ class CriteriaController extends \BaseController
873 878
                 $criterionId = $criterion->id;
874 879
                 DB::table('criterion_objective_outcome as cobo')
875 880
                     ->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
876
-                    ->where($criterionId)
881
+                    ->where('cobo.criterion_id', $criterionId)
877 882
                     ->delete();
878 883
                 // DB::delete("delete from `criterion_objective_outcome` where `criterion_id` ={$criterionId}");
879 884
                 DB::delete("delete from `program_criterion` where `criterion_id` ={$criterionId}");
@@ -964,9 +969,9 @@ class CriteriaController extends \BaseController
964 969
 
965 970
                         break;
966 971
                 }*/
967
-                foreach ($clean_input['program_id'] as $program_id) {
968
-                    DB::insert("insert into `program_criterion` (`criterion_id`, `program_id`) values({$criterionId},{$program_id})");
969
-                }
972
+                //foreach ($clean_input['program_id'] as $program_id) {
973
+                //    DB::insert("insert into `program_criterion` (`criterion_id`, `program_id`) values({$criterionId},{$program_id})");
974
+                //}
970 975
 
971 976
 
972 977
 

+ 40
- 1
app/controllers/Objective2Controller.php Переглянути файл

@@ -248,6 +248,42 @@ class Objective2Controller extends \BaseController
248 248
 		return Objective::find(Input::get('id'));
249 249
 	}
250 250
 
251
+	public function postDeleteAll()
252
+	{
253
+		$program_id = Input::get('program_id');
254
+		$objective_id = Input::get('objective_id');
255
+		$outcome_id = Input::get('outcome_id');
256
+
257
+		$all_criteria = DB::table("criterion_objective_outcome as cobo")
258
+			->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'cobo.id')
259
+			->where("objective_id", $objective_id)
260
+			->where('outcome_id', $outcome_id)
261
+
262
+			->where('program_id', $program_id)
263
+			->select('poco.id as poco_id', 'cobo.id as cobo_id', 'criterion_id')
264
+			->get();
265
+		DB::beginTransaction();
266
+		foreach ($all_criteria as $crit) {
267
+			Input::replace([
268
+				'program_id' => $program_id,
269
+				'objective_id' => $objective_id,
270
+				'outcome_id' => $outcome_id,
271
+				'criterion_id' => $crit->criterion_id,
272
+				'pcobo_id' => $crit->poco_id,
273
+				'cobo_id' => $crit->cobo_id
274
+			]);
275
+
276
+			if ($this->deletePCOBO() != 200) {
277
+				return "0";
278
+				DB::rollback();
279
+			}
280
+		}
281
+		DB::commit();
282
+
283
+
284
+		return "200";
285
+	}
286
+
251 287
 	public function fetchProgramCriteria()
252 288
 	{
253 289
 		$outcome_id = Input::get("outcome_id");
@@ -623,7 +659,10 @@ class Objective2Controller extends \BaseController
623 659
 				}
624 660
 				if ($clean_input['agreement']) {
625 661
 					DB::table('criterion_objective_outcome')
626
-						->join('program_criterion', 'criterion_objective_outcome.criterion_id', "=", 'program_criterion.criterion_id')
662
+						//QUE PONEMOS CORRADA
663
+						->join('program_criterion_objective_outcome', 'criterion_objective_outcome.id', "=", 'program_criterion_objective_outcome.cri_obj_out_id')
664
+
665
+						//->join('program_criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', "=", 'program_criterion_objective_outcome.criterion_id')
627 666
 						->whereIn('program_id', $clean_input['program_id'])
628 667
 						->whereIn('outcome_id', $clean_input['outcome_id'])
629 668
 						->where('objective_id', '=', 0)

+ 10
- 5
app/controllers/ObjectivesController.php Переглянути файл

@@ -242,8 +242,8 @@ class ObjectivesController extends \BaseController
242 242
     }
243 243
 
244 244
     $criteria_scales = DB::table('criteria')
245
-      ->join('criterion_objective_outcome as cobo', 'criterion_id', '=', 'criteria.id')
246
-      ->join('program_criterion', 'cobo.criterion_id', '=', 'program_criterion.criterion_id')
245
+      ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'criteria.id')
246
+      ->join('program_criterion_objective_outcome as poco', 'cobo.id', '=', 'poco.cri_obj_out_id')
247 247
       ->whereIn('program_id', $program_ids)
248 248
       ->where('objective_id', $objective->id)
249 249
       ->select('num_scales')
@@ -255,7 +255,7 @@ class ObjectivesController extends \BaseController
255 255
 
256 256
       $objective->criteria[$num_scales] = DB::table('criteria')
257 257
         ->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'criteria.id')
258
-        ->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
258
+        ->join('program_criterion_objective_outcome as poco', 'cobo.id', '=', 'poco.cri_obj_out_id')
259 259
         ->whereIn('program_id', $program_ids)
260 260
         ->where('objective_id', $objective->id)
261 261
         ->where('num_scales', $num_scales)
@@ -265,8 +265,13 @@ class ObjectivesController extends \BaseController
265 265
 
266 266
       foreach ($objective->criteria[$num_scales] as $criteria) {
267 267
         $criteria->programs = DB::table('programs')
268
-          ->join('program_criterion', 'programs.id', '=', 'program_criterion.program_id')
268
+          ->join('program_criterion_objective_outcome as poco', 'poco.program_id', '=', 'programs.id')
269
+          ->join('criterion_objective_outcome as cobo', 'cobo.id', '=', 'poco.cri_obj_out_id')
270
+
271
+
269 272
           ->where('criterion_id', $criteria->criterion_id)
273
+          ->select("programs.*")
274
+          ->distinct()
270 275
           ->get();
271 276
 
272 277
         $criteria->outcomes = DB::table('outcomes')
@@ -289,4 +294,4 @@ class ObjectivesController extends \BaseController
289 294
       'objective' => $objective
290 295
     );
291 296
   }
292
-}
297
+}

+ 78
- 134
app/controllers/OutcomesController.php Переглянути файл

@@ -14,7 +14,7 @@ class OutcomesController extends \BaseController
14 14
     {
15 15
         $title = "Learning Outcomes";
16 16
         $outcomes = Outcome::withTrashed()->orderBy('id', 'ASC')->get();
17
-//         $outcomes = Outcome::withTrashed()->orderBy('name', 'ASC')->get();
17
+        //         $outcomes = Outcome::withTrashed()->orderBy('name', 'ASC')->get();
18 18
         $schools = School::orderBy('name', 'ASC')->get();
19 19
         // $semesters_ids = Session::get('semesters_ids');
20 20
         // $semesters = Semester::whereIn('id',$semesters_ids)->get();
@@ -343,28 +343,26 @@ class OutcomesController extends \BaseController
343 343
     public function delete()
344 344
     {
345 345
         $outcomeArray = json_decode(Input::get('outcomeArray'), true);
346
-// 		Log::info("delete".json_encode($outcomeArray));
347
-		$outcome = Outcome::withTrashed()
348
-			->where('id', '=', $outcomeArray['id'])
349
-			->firstOrFail();
350
-// 		Log::info("delete2".json_encode($outcome));
351
-		$outcome->forceDelete();
352
-// 		Log::info("sal".json_encode($sal));
353
-// 		if($sal)
354
-		{
355
-			Session::flash('status', 'success');
356
-			Session::flash('message', 'Learning Outcome deleted.');
357
-			
358
-		}
359
-
360
-	}
361
-    
346
+        // 		Log::info("delete".json_encode($outcomeArray));
347
+        $outcome = Outcome::withTrashed()
348
+            ->where('id', '=', $outcomeArray['id'])
349
+            ->firstOrFail();
350
+        // 		Log::info("delete2".json_encode($outcome));
351
+        $outcome->forceDelete();
352
+        // 		Log::info("sal".json_encode($sal));
353
+        // 		if($sal)
354
+        {
355
+            Session::flash('status', 'success');
356
+            Session::flash('message', 'Learning Outcome deleted.');
357
+        }
358
+    }
359
+
362 360
     public function updateMore()
363 361
     {
364 362
         $outcomeArray = json_decode(Input::get('outcomeArray'), true);
365 363
         Session::flash('status', 'success');
366 364
         Session::flash('message', 'Learning Outcomes updated.');
367
-		Log::info("Ahora1".json_encode($outcomeArray));
365
+        Log::info("Ahora1" . json_encode($outcomeArray));
368 366
 
369 367
         foreach ($outcomeArray as $outcomeObject) {
370 368
 
@@ -375,9 +373,9 @@ class OutcomesController extends \BaseController
375 373
                     'definition' => $outcomeObject['definition'],
376 374
                     'expected_outcome' => $outcomeObject['expected_outcome'],
377 375
                     'activation_date' => $outcomeObject['activation_date'],
378
-//                     'deactivation_date' => (isset($outcomeObject['deactivation_date'])?$outcomeObject['deactivation_date']:NULL),
376
+                    //                     'deactivation_date' => (isset($outcomeObject['deactivation_date'])?$outcomeObject['deactivation_date']:NULL),
379 377
                     'level' => $outcomeObject['level'],
380
-//                     'new_outcome_id'=>$outcomeObject['new_outcome_id']
378
+                    //                     'new_outcome_id'=>$outcomeObject['new_outcome_id']
381 379
                     // TODO- validar los otros 3 valores
382 380
                 ),
383 381
                 array(
@@ -385,9 +383,9 @@ class OutcomesController extends \BaseController
385 383
                     'definition' => 'required',
386 384
                     'expected_outcome' => 'required|numeric',
387 385
                     'activation_date' => 'required|date',
388
-//                     'deactivation_date' => 'sometimes|required|date',
386
+                    //                     'deactivation_date' => 'sometimes|required|date',
389 387
                     'level' => 'required|numeric'
390
-//                     'new_outcome_id' => 'required|numeric'
388
+                    //                     'new_outcome_id' => 'required|numeric'
391 389
                     // TODO- los requisitos de los otros 3 valores
392 390
                 )
393 391
             );
@@ -401,18 +399,15 @@ class OutcomesController extends \BaseController
401 399
                     $outcome->definition = $outcomeObject['definition'];
402 400
                     $outcome->expected_outcome = $outcomeObject['expected_outcome'];
403 401
                     $outcome->activation_date = $outcomeObject['activation_date'];
404
-                    if($outcomeObject['deactivation_date']!="")
405
-                    {
406
-                    	$outcome->deactivation_date = $outcomeObject['deactivation_date'];
407
-	                    if(isset($outcomeObject['new_outcome_id']))$outcome->new_outcome_id = $outcomeObject['new_outcome_id'];
408
-                    }
409
-                    else 
410
-                    {
411
-                    	$outcome->deactivation_date = NULL;
412
-                    	$outcome->new_outcome_id=NULL;
402
+                    if ($outcomeObject['deactivation_date'] != "") {
403
+                        $outcome->deactivation_date = $outcomeObject['deactivation_date'];
404
+                        if (isset($outcomeObject['new_outcome_id'])) $outcome->new_outcome_id = $outcomeObject['new_outcome_id'];
405
+                    } else {
406
+                        $outcome->deactivation_date = NULL;
407
+                        $outcome->new_outcome_id = NULL;
413 408
                     }
414 409
                     $outcome->level = $outcomeObject['level'];
415
-		Log::info("Ahora2".json_encode($outcome));
410
+                    Log::info("Ahora2" . json_encode($outcome));
416 411
 
417 412
                     $outcome->save();
418 413
 
@@ -448,22 +443,24 @@ class OutcomesController extends \BaseController
448 443
 
449 444
     public function fetchCriteria()
450 445
     {
451
-        // 		var_dump((Input::get('filter')));
452
-        // 		exit();
446
+        $criteria_not_available = DB::table('criterion_objective_outcome')
447
+            ->where('objective_id', '=', 0)
448
+            ->lists('criterion_id');
449
+        $criteria = DB::table('criteria')
450
+            ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id');
453 451
         if (Input::get('filter')) {
454 452
             switch (Input::get('filter')) {
455 453
                 case 'all':
456
-                    $criteria = DB::table('criteria')
454
+                    /*$criteria = DB::table('criteria')
457 455
                         ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
458 456
                         ->where('criterion_objective_outcome.outcome_id', '=', Input::get('outcome_id'))
459 457
                         ->where('criterion_objective_outcome.objective_id', '=', Input::get('objective_id'))
460 458
                         ->where('criteria.num_scales', '=', Input::get('num_scales'))
461
-                        ->where('criteria.max_score', '=', Input::get('maximum'))
462
-                        ->select('criterion_id as id', 'name')
463
-                        ->orderBy('name', 'ASC')
464
-                        ->get();
459
+                        ->where('criteria.max_score', '=', Input::get('maximum'))*/
460
+
465 461
 
466
-                    foreach ($criteria as $criterion) {
462
+
463
+                    /*foreach ($criteria as $criterion) {
467 464
                         $criterion->program_ids = json_encode(DB::table('program_criterion')
468 465
                             ->where('criterion_id', $criterion->id)
469 466
                             ->lists('program_id'));
@@ -475,6 +472,7 @@ class OutcomesController extends \BaseController
475 472
                             ->lists('text');
476 473
                     }
477 474
                     return $criteria;
475
+                    break;*/
478 476
                     break;
479 477
 
480 478
                 case 'school':
@@ -483,17 +481,15 @@ class OutcomesController extends \BaseController
483 481
 
484 482
                         // Fetch all the programs whose school is the user's
485 483
                         $program_ids = DB::table('programs')->where('school_id', Auth::user()->school_id)->lists('id');
486
-                        $criteria = DB::table('criteria')
487
-                            ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
488
-                            ->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
489
-                            ->where('criterion_objective_outcome.outcome_id', '=', Input::get('outcome_id'))
490
-                            ->where('criterion_objective_outcome.objective_id', '=', Input::get('objective_id'))
491
-                            ->where('criteria.num_scales', '=', Input::get('num_scales'))
492
-                            ->where('criteria.max_score', '=', Input::get('maximum'))
493
-                            ->whereIn('program_criterion.program_id', $program_ids)
494
-                            ->select('criterion_id as id', 'name')
495
-                            ->orderBy('name', 'ASC')
496
-                            ->get();
484
+                    } else {
485
+                        $program_ids = DB::table('programs')->where('school_id', Auth::user()->programs[0]->school->id)->lists('id');
486
+                    }
487
+                    $criteria = $criteria
488
+                        ->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
489
+
490
+                        ->whereIn('poco.program_id', $program_ids);
491
+
492
+                    /*
497 493
                         foreach ($criteria as $criterion) {
498 494
                             $criterion->program_ids = json_encode(DB::table('program_criterion')
499 495
                                 ->where('criterion_id', $criterion->id)
@@ -506,57 +502,21 @@ class OutcomesController extends \BaseController
506 502
                                 ->lists('text'));
507 503
                         }
508 504
                         // Return all criteria belonging to any of those programs
509
-                        return $criteria;
510
-                    }
505
+                        return $criteria;*/
511 506
 
512
-                    // If pcoord
513
-                    else {
514 507
 
515
-                        // Fetch all the programs from the user's school;
516
-                        // Fetch all the programs from the user's school;
517
-                        $program_ids = DB::table('programs')->where('school_id', Auth::user()->programs[0]->school->id)->lists('id');
518 508
 
519
-                        $criteria = DB::table('criteria')
520
-                            ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
521
-                            ->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
522
-                            ->where('criterion_objective_outcome.outcome_id', '=', Input::get('outcome_id'))
523
-                            ->where('criterion_objective_outcome.objective_id', '=', Input::get('objective_id'))
524
-                            ->where('criteria.num_scales', '=', Input::get('num_scales'))
525
-                            ->where('criteria.max_score', '=', Input::get('maximum'))
526
-                            ->whereIn('program_criterion.program_id', $program_ids)
527
-                            ->select('criterion_id as id', 'name')
528
-                            ->orderBy('name', 'ASC')
529
-                            ->get();
530 509
 
531
-                        foreach ($criteria as $criterion) {
532
-                            $criterion->program_ids = json_encode(DB::table('program_criterion')
533
-                                ->where('criterion_id', $criterion->id)
534
-                                ->lists('program_id'));
535
-                            $criterion->objectives = json_encode(DB::table('criterion_objective_outcome')
536
-                                ->join('objectives', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
537
-                                ->where('criterion_id', $criterion->id)
538
-                                ->select('objectives.*')
539
-                                ->distinct()
540
-                                ->lists('text'));
541
-                        }
542
-                        return $criteria;
543
-                    }
544 510
 
545 511
                     break;
546 512
 
547 513
                 case 'program':
548
-                    $criteria = DB::table('criteria')
549
-                        ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
550
-                        ->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
551
-                        ->where('criterion_objective_outcome.outcome_id', '=', Input::get('outcome_id'))
552
-                        ->where('criterion_objective_outcome.objective_id', '=', Input::get('objective_id'))
553
-                        ->where('criteria.num_scales', '=', Input::get('num_scales'))
554
-                        ->where('criteria.max_score', '=', Input::get('maximum'))
555
-                        ->whereIn('program_criterion.program_id', Auth::user()->programs->lists('id'))
556
-                        ->select('criterion_id as id', 'name')
557
-                        ->orderBy('name', 'ASC')
558
-                        ->get();
559
-                    foreach ($criteria as $criterion) {
514
+
515
+                    $criteria = $criteria
516
+                        ->join('program_criterion_objective_outcome as poco', 'poco.cri_obj_out_id', '=', 'criterion_objective_outcome.id')
517
+
518
+                        ->whereIn('poco.program_id', Auth::user()->programs->lists('id'));
519
+                    /*foreach ($criteria as $criterion) {
560 520
                         $criterion->program_ids = json_encode(DB::table('program_criterion')
561 521
                             ->where('criterion_id', $criterion->id)
562 522
                             ->lists('program_id'));
@@ -567,21 +527,13 @@ class OutcomesController extends \BaseController
567 527
                             ->distinct()
568 528
                             ->lists('text'));
569 529
                     }
570
-                    return $criteria;
530
+                    return $criteria;*/
571 531
                     break;
572 532
 
573 533
                 default:
574
-                    $criteria = DB::table('criteria')
575
-                        ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
576
-                        ->where('criterion_objective_outcome.outcome_id', '=', Input::get('outcome_id'))
577
-                        ->where('criterion_objective_outcome.objective_id', '=', Input::get('objective_id'))
578
-                        ->where('criteria.num_scales', '=', Input::get('num_scales'))
579
-                        ->where('criteria.max_score', '=', Input::get('maximum'))
580
-                        ->select('criterion_id as id', 'name')
581
-                        ->orderBy('name', 'ASC')
582
-                        ->get();
583 534
 
584
-                    foreach ($criteria as $criterion) {
535
+
536
+                    /*foreach ($criteria as $criterion) {
585 537
                         $criterion->program_ids = json_encode(DB::table('program_criterion')
586 538
                             ->where('criterion_id', $criterion->id)
587 539
                             ->lists('program_id'));
@@ -592,33 +544,21 @@ class OutcomesController extends \BaseController
592 544
                             ->distinct()
593 545
                             ->lists('text'));
594 546
                     }
595
-                    return $criteria;
547
+                    return $criteria;*/
596 548
                     break;
597 549
             }
598
-        } else {
599
-            $criteria = DB::table('criteria')
600
-                ->join('criterion_objective_outcome', 'criterion_objective_outcome.criterion_id', '=', 'criteria.id')
601
-                ->where('criterion_objective_outcome.outcome_id', '=', Input::get('outcome_id'))
602
-                ->where('criterion_objective_outcome.objective_id', '=', Input::get('objective_id'))
603
-                ->where('criteria.num_scales', '=', Input::get('num_scales'))
604
-                ->where('criteria.max_score', '=', Input::get('maximum'))
605
-                ->select('criterion_id as id', 'name')
606
-                ->orderBy('name', 'ASC')
607
-                ->get();
608
-
609
-            foreach ($criteria as $criterion) {
610
-                $criterion->program_ids = json_encode(DB::table('program_criterion')
611
-                    ->where('criterion_id', $criterion->id)
612
-                    ->lists('program_id'));
613
-                $criterion->objectives = json_encode(DB::table('criterion_objective_outcome')
614
-                    ->join('objectives', 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
615
-                    ->where('criterion_id', $criterion->id)
616
-                    ->select('objectives.*')
617
-                    ->distinct()
618
-                    ->lists('text'));
619
-            }
620
-            return $criteria;
621 550
         }
551
+
552
+        $criteria = $criteria
553
+            ->where('criterion_objective_outcome.outcome_id', '=', Input::get('outcome_id'))
554
+            ->where('criterion_objective_outcome.objective_id', '=', Input::get('objective_id'))
555
+            ->where('criteria.num_scales', '=', Input::get('num_scales'))
556
+            ->where('criteria.max_score', '=', Input::get('maximum'))
557
+            ->whereNotIn('criteria.id', $criteria_not_available)
558
+            ->select('criterion_id as id', 'name')
559
+            ->orderBy('name', 'ASC')
560
+            ->get();
561
+        return $criteria;
622 562
     }
623 563
 
624 564
     /**
@@ -715,7 +655,7 @@ class OutcomesController extends \BaseController
715 655
         $diferent_levels = DB::table('criterion_objective_outcome')
716 656
             ->join('criteria', 'criteria.id', '=', 'criterion_objective_outcome.criterion_id')
717 657
             // GASP, añadí programa, para que solo muestre niveles de criterios del programa
718
-            ->join('program_criterion', 'criteria.id', '=', 'program_criterion.criterion_id')
658
+            ->join('program_criterion_objective_outcome', 'criterion_objective_outcome.id', '=', 'program_criterion_objective_outcome.cri_obj_out_id')
719 659
             ->whereIn('program_id', $program_ids)
720 660
             ->where('criterion_objective_outcome.outcome_id', $id)
721 661
             ->distinct('criteria.num_scales')
@@ -739,8 +679,8 @@ class OutcomesController extends \BaseController
739 679
             //                 ->get();
740 680
             $outcome_criterias = DB::table('criterion_objective_outcome')
741 681
                 ->join('criteria', 'criteria.id', '=', 'criterion_objective_outcome.criterion_id')
742
-                ->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
743
-                ->whereIn('program_criterion.program_id', $program_ids)
682
+                ->join('program_criterion_objective_outcome', 'criterion_objective_outcome.id', '=', 'program_criterion_objective_outcome.cri_obj_out_id')
683
+                ->whereIn('program_criterion_objective_outcome.program_id', $program_ids)
744 684
                 ->where('criterion_objective_outcome.outcome_id', $id)
745 685
                 ->where('criteria.num_scales', $level)
746 686
                 ->select('criteria.id', 'criteria.name', 'criteria.deleted_at')
@@ -753,10 +693,14 @@ class OutcomesController extends \BaseController
753 693
                 $scales = DB::select("select * FROM scales INNER join `criterion_scale` on `criterion_scale`.`scale_id` = `scales`.`id` where criterion_scale.criterion_id ={$criteria_id->id} ORDER BY position");
754 694
 
755 695
                 $programs = DB::table('programs')
756
-                    ->join('program_criterion', 'program_criterion.program_id', '=', 'programs.id')
696
+                    ->join('program_criterion_objective_outcome', 'programs.id', '=', 'program_criterion_objective_outcome.program_id')
697
+                    ->join('criterion_objective_outcome as cobo', 'cobo.id', '=', 'program_criterion_objective_outcome.cri_obj_out_id')
698
+                    //->join('program_criterion', 'program_criterion.program_id', '=', 'programs.id')
757 699
                     ->where('criterion_id', $criteria_id->id)
700
+                    ->select('programs.*')
701
+                    ->distinct()
758 702
                     ->lists('programs.name');
759
-                Log::info($scales);
703
+                // Log::info($scales);
760 704
 
761 705
                 /* $scales =
762 706
                     DB::select(

+ 9
- 9
app/controllers/ProgramsController.php Переглянути файл

@@ -282,9 +282,9 @@ class ProgramsController extends \BaseController
282 282
       $domains = DB::table('outcomes')
283 283
         ->join('criterion_objective_outcome as cobo', 'cobo.outcome_id', '=', 'outcomes.id')
284 284
         ->join('criteria', 'criteria.id', '=', 'cobo.criterion_id')
285
-        ->join('program_criterion', 'criteria.id', '=', 'program_criterion.criterion_id')
286
-        ->join('courses', 'courses.program_id', '=', 'program_criterion.program_id')
287
-        ->where('program_criterion.program_id', $program->id)
285
+        ->join('program_criterion_objective_outcome', 'cobo.id', '=', 'program_criterion_objective_outcome.cri_obj_out_id')
286
+        ->join('courses', 'courses.program_id', '=', 'program_criterion_objective_outcome.program_id')
287
+        ->where('program_criterion_objective_outcome.program_id', $program->id)
288 288
         ->select('outcomes.name', 'outcomes.activation_date')
289 289
         ->distinct()
290 290
         ->orderBy('outcomes.name', 'asc')
@@ -306,9 +306,9 @@ class ProgramsController extends \BaseController
306 306
       $courses_used =  DB::table('outcomes')
307 307
         ->join('criterion_objective_outcome as cobo', 'cobo.outcome_id', '=', 'outcomes.id')
308 308
         ->join('criteria', 'criteria.id', '=', 'cobo.criterion_id')
309
-        ->join('program_criterion', 'criteria.id', '=', 'program_criterion.criterion_id')
310
-        ->join('courses', 'courses.program_id', '=', 'program_criterion.program_id')
311
-        ->where('program_criterion.program_id', $program->id)
309
+        ->join('program_criterion_objective_outcome', 'cobo.id', '=', 'program_criterion_objective_outcome.cri_obj_out_id')
310
+        ->join('courses', 'courses.program_id', '=', 'program_criterion_objective_outcome.program_id')
311
+        ->where('program_criterion_objective_outcome.program_id', $program->id)
312 312
         ->select('courses.number', 'outcomes.name as domain_name', 'courses.code')
313 313
         ->distinct()
314 314
         ->orderBy('courses.name', 'asc')
@@ -328,14 +328,14 @@ class ProgramsController extends \BaseController
328 328
       $transformative_actions = DB::table('outcomes')
329 329
         ->join('criterion_objective_outcome as cobo', 'cobo.outcome_id', '=', 'outcomes.id')
330 330
         ->join('criteria', 'criteria.id', '=', 'cobo.criterion_id')
331
-        ->join('program_criterion', 'criteria.id', '=', 'program_criterion.criterion_id')
332
-        ->join('courses', 'courses.program_id', '=', 'program_criterion.program_id')
331
+        ->join('program_criterion_objective_outcome', 'cobo.id', '=', 'program_criterion_objective_outcome.cri_obj_out_id')
332
+        ->join('courses', 'courses.program_id', '=', 'program_criterion_objective_outcome.program_id')
333 333
 
334 334
         ->join('activities', 'activities.course_id', '=', 'courses.id')
335 335
         ->join('activity_criterion', 'activity_criterion.activity_id', '=', 'activities.id')
336 336
         ->join('transformative_activity_criterion as taa', 'taa.activity_criterion_id', '=', 'activity_criterion.id')
337 337
         ->join('transformative_actions', 'transformative_actions.id', '=', 'taa.trans_action_id')
338
-        ->where('program_criterion.program_id', $program->id)
338
+        ->where('program_criterion_objective_outcome.program_id', $program->id)
339 339
         ->select('transformative_actions.description', 'outcomes.name as domain_name')
340 340
         ->distinct()
341 341
         ->orderBy('transformative_actions.description', 'asc')

+ 25
- 4
app/controllers/TemplatesController.php Переглянути файл

@@ -252,6 +252,8 @@ class TemplatesController extends \BaseController
252 252
 		// 			Log::info("aqui".(count($criteria)));
253 253
 		// 			Log::info(json_encode(count($criteria)));
254 254
 
255
+
256
+
255 257
 		$templates = Template::where('school_id', '=', $school_id_user)->orWhere('school_id', '=', NULL)
256 258
 			->orderBy('name', 'ASC')->get();
257 259
 		$criteria_ids = array();
@@ -274,6 +276,22 @@ class TemplatesController extends \BaseController
274 276
 		$templates_dentro = Template::whereNotIn('id', $templates_fuera_ids)
275 277
 			->orderBy('name', 'ASC')->get();
276 278
 
279
+		/*$templates_dentro = Template::join('template_criterion', 'template_criterion.template_id', '=', 'templates.id')
280
+			->join('criterion_objective_outcome as cobo', 'cobo.criterion_id', '=', 'template_criterion.criterion_id')
281
+			->where('objective_id', '<>', '0')
282
+
283
+			->where(function ($query) use ($school_id_user) {
284
+				$query->where('school_id', $school_id_user)
285
+					->orWhere('school_id', '=', NULL);
286
+			})
287
+
288
+			//			->orWhere('school_id', '=', NULL)
289
+
290
+			->orderBy('name', 'ASC')
291
+			->groupBy('templates.id')
292
+			->select("templates.*")
293
+			->get();*/
294
+
277 295
 		// 			if(!isset($templates_dentro))$templates_dentro=
278 296
 
279 297
 		// 			var_dump(json_encode($templates_dentro));
@@ -296,7 +314,7 @@ class TemplatesController extends \BaseController
296 314
 				return "NO pa";
297 315
 			}
298 316
 
299
-			$crit->all_objectives = Objective::join("criterion_objective_outcome", 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
317
+			$crit->all_objectives = DB::table("objectives")->join("criterion_objective_outcome", 'objectives.id', '=', 'criterion_objective_outcome.objective_id')
300 318
 				->where('criterion_id', $crit->id)
301 319
 				->select('objectives.*')
302 320
 				->groupBy('objectives.id')
@@ -452,9 +470,12 @@ class TemplatesController extends \BaseController
452 470
 				->orderBy('position', 'ASC')
453 471
 				->get();
454 472
 
455
-			$temp_crit->program_ids = json_encode(DB::table('program_criterion')
456
-				->where('criterion_id', $temp_crit->id)
457
-				->lists('program_id'));
473
+			$temp_crit->program_ids = json_encode(DB::table('program_criterion_objective_outcome')
474
+				->join('criterion_objective_outcome', 'criterion_objective_outcome.id', '=', 'program_criterion_objective_outcome.cri_obj_out_id')
475
+				->where('criterion_objective_outcome.criterion_id', $temp_crit->id)
476
+				->select('program_criterion_objective_outcome.program_id')
477
+				->distinct()
478
+				->lists('program_criterion_objective_outcome.program_id'));
458 479
 
459 480
 			Log::info("ee" . json_encode($temp_crit->program_ids));
460 481
 

+ 88
- 2
app/controllers/ThreeYearPlanController.php Переглянути файл

@@ -321,8 +321,8 @@ class ThreeYearPlanController extends \BaseController
321 321
     $program_id = Input::get('program_id');
322 322
 
323 323
     // get program_id
324
-    $user_id = auth::user()->id;
325
-    Log::info(Input::all());
324
+    //$user_id = auth::user()->id;
325
+    //Log::info(Input::all());
326 326
 
327 327
     // get typ_program_id
328 328
     $result = DB::table('typ_program')
@@ -1070,4 +1070,90 @@ class ThreeYearPlanController extends \BaseController
1070 1070
       return $pdf->stream(basename($queryToPath->path_to_pdf));
1071 1071
   }
1072 1072
   */
1073
+
1074
+  ///////////////////
1075
+  //
1076
+  //Pair everything
1077
+  //
1078
+  ////////////////////
1079
+
1080
+  public function pairEveryObjective()
1081
+  {
1082
+    Log::info(Input::all());
1083
+    $selected_objectives = Input::get('selected_objectives');
1084
+    $typ_id = Input::get('typ_id');
1085
+    $program_id = Input::get('program_id');
1086
+    for ($i = 0; $i < count($selected_objectives); $i += 3) {
1087
+      Input::replace([
1088
+        'program_id' => $program_id,
1089
+        'new_objective_id' => $selected_objectives[$i + 2],
1090
+        'outcome_id' => $selected_objectives[$i],
1091
+        'semester_id' => $selected_objectives[$i + 1],
1092
+        'typ_id' => $typ_id,
1093
+        'previous_objective_id' => 'nothing_selected'
1094
+
1095
+
1096
+      ]);
1097
+      if ($this->section2_on_change() != 'update was succes')
1098
+        return 0;
1099
+    }
1100
+    return 200;
1101
+  }
1102
+
1103
+  public function pairEveryCourse()
1104
+  {
1105
+    Log::info(Input::all());
1106
+    $typ_id = Input::get('typ_id');
1107
+    $program_id = Input::get('program_id');
1108
+    $pairing_array = Input::get('pairing_array');
1109
+    $type_of_work = Input::get("type_of_work");
1110
+
1111
+    //$typ_id = Input::get('typ_id');
1112
+    //$outcome_id = Input::get('outcome_id');
1113
+    //$semester_id = Input::get('semester_id');
1114
+    //$objective_id = Input::get('objective_id');
1115
+    //$previous_course_id = Input::get('previous_course_id');
1116
+    //$new_course_id = Input::get('new_course_id');
1117
+
1118
+    // get program_id
1119
+    //$program_id = Input::get('program_id');
1120
+
1121
+
1122
+    if ($type_of_work == 'este_semestre') {
1123
+      foreach ($pairing_array as $course_array) {
1124
+        Input::replace([
1125
+          'outcome_id' => $course_array[0],
1126
+          'semester_id' => $course_array[1],
1127
+          'objective_id' => $course_array[2],
1128
+          'new_course_id' => $course_array[3],
1129
+          'typ_id' => $typ_id,
1130
+          'previous_course_id' => 'nothing_selected',
1131
+          'program_id' => $program_id,
1132
+
1133
+
1134
+        ]);
1135
+        if ($this->section3_on_change() != 'update succes?')
1136
+          return 0;
1137
+      }
1138
+    } else {
1139
+      foreach ($pairing_array as $semester_array) {
1140
+        foreach ($semester_array as $course_array) {
1141
+          Input::replace([
1142
+            'outcome_id' => $course_array[0],
1143
+            'semester_id' => $course_array[1],
1144
+            'objective_id' => $course_array[2],
1145
+            'new_course_id' => $course_array[3],
1146
+            'typ_id' => $typ_id,
1147
+            'previous_course_id' => 'nothing_selected',
1148
+            'program_id' => $program_id,
1149
+
1150
+
1151
+          ]);
1152
+          if ($this->section3_on_change() != 'update succes?')
1153
+            return 0;
1154
+        }
1155
+      }
1156
+    }
1157
+    return 200;
1158
+  }
1073 1159
 }

+ 2
- 2
app/models/Criterion.php Переглянути файл

@@ -39,13 +39,13 @@ class Criterion extends Eloquent
39 39
 	}
40 40
 
41 41
 
42
-	public function scopeFromProgram($query, $programs)
42
+	/*public function scopeFromProgram($query, $programs)
43 43
 	{
44 44
 
45 45
 		return $query->join('program_criterion', 'program_criterion.criterion_id', '=', 'criteria.id')
46 46
 			->whereIn("program_id", "programs")
47 47
 			->select('criteria.*');
48
-	}
48
+	}*/
49 49
 
50 50
 	/**
51 51
 	 * Return the program that the criterion belongs to

+ 15
- 0
app/routes.php Переглянути файл

@@ -182,7 +182,12 @@ Route::group(array('before' => 'auth|has_access'), function () {
182 182
     );
183 183
 
184 184
 
185
+    //Para feature de import rubrics
185 186
 
187
+    Route::post("fetchTemplatesForCriteria", "AnnualPlansController@fetchTemplatesForCriteria");
188
+    Route::post("pairCriteriaFromTemplate", "AnnualPlansController@pairCriteriaFromTemplate");
189
+
190
+    //end feature
186 191
 
187 192
     Route::post('postAnnualReport/{annual_id?}', 'AnnualPlansController@postAnnualReport');
188 193
     Route::get('printAnnualPlan/{annual_plan?}/{submit?}', 'AnnualPlansController@printAnnualPlan');
@@ -241,6 +246,15 @@ Route::group(array('before' => 'auth|has_access'), function () {
241 246
     Route::get("downloadThreeYearPlanPDF/{path_id}", "ThreeYearPlanController@showHTML");
242 247
     Route::get("findHTMLlinksTYP/{path_id}", 'ThreeYearPlanController@findHTML');
243 248
 
249
+    /////////////////////////////////////////
250
+    // 
251
+    //  pairing everything in three year
252
+    //
253
+    /////////////////////////////////////////
254
+
255
+
256
+    Route::post('pairEveryObjective', "ThreeYearPlanController@pairEveryObjective");
257
+    Route::post('pairEveryCourse', "ThreeYearPlanController@pairEveryCourse");
244 258
     //View annual plans and report
245 259
 
246 260
     Route::get('{annual_report_or_plan}/show/{program_id}', "AnnualPlansController@annualPlansShow");
@@ -377,6 +391,7 @@ Route::group(array('before' => 'auth|has_access'), function () {
377 391
     Route::post('fetchOutcome', array('before' => 'csrf', 'uses' => 'OutcomesController@fetchOutcome'));
378 392
     // Show users all objectives and criteria
379 393
     Route::get('learning-objectives-criteria', 'Objective2Controller@viewObjectives');
394
+    Route::post("postDeleteAllCriteria", 'Objective2Controller@postDeleteAll');
380 395
     Route::post('fetchObjectiveForCriteria', array('before' => 'csrf', 'uses' => 'ObjectivesController@fetchObjectiveForCriteria'));
381 396
 
382 397
     // Show professor overview to users with courses

+ 77
- 5
app/views/global/view-objectives-criteria.blade.php Переглянути файл

@@ -103,8 +103,9 @@
103 103
                             
104 104
                         </select>
105 105
                     </div>
106
-                    <hr>
106
+                 
107 107
                     <label>Criteria associated to program</label>
108
+                    
108 109
                     <div id="program_objectives" class ='form-group col-md-12' >
109 110
 
110 111
                     </div>
@@ -116,7 +117,7 @@
116 117
 
117 118
                 </div>
118 119
                 <div class="modal-footer">
119
-                    <hr>
120
+                    
120 121
                     <button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="">Close</button>
121 122
 
122 123
                 </div>
@@ -285,7 +286,9 @@
285 286
                         $(button).parent().parent().remove();
286 287
                         if(program_div.children('.removable_div').length === 0){
287 288
 
288
-                            program_div.prepend(addSelect('#'+ program_div.attr('id'), options));
289
+                            addSelect('#'+ program_div.attr('id'), options);
290
+                            //row.after(addSelect('#'+ program_div.attr('id'), options))
291
+                            //program_div.prepend(addSelect('#'+ program_div.attr('id'), options));
289 292
                             
290 293
                         }
291 294
                     //$('.selected_criteria_to_delete').parent().parent().remove();
@@ -311,6 +314,7 @@
311 314
             })
312 315
             select = $('<select>',{
313 316
                 'class':'selectpicker form-control criteria_select',
317
+                'data-live-search': 'true',
314 318
                 'name':'criteria[]',
315 319
                 'onchange':'saveChanges(this)'
316 320
 
@@ -424,6 +428,68 @@
424 428
 
425 429
         }
426 430
 
431
+        function createDeleteAllButton(program, outcome_id, objective_id){
432
+
433
+            div_row = $("<div>",{
434
+                'class':'row button-delete'
435
+            });
436
+            div_col = $("<div>",{
437
+                'class':'col-md-12'
438
+            });
439
+            div_row.append(div_col);
440
+            div_btn_group = $("<div>",{
441
+                'class':'btn-group pull-right',
442
+                
443
+            });
444
+
445
+            //criteria = program.criteria;
446
+
447
+            //outcome_id = criteria[0];
448
+
449
+            div_btn = $('<button>', {
450
+                'class':'btn btn-md btn-primary pull-right',
451
+                'onclick': 'showDeleteAllProgram('+program.id+', '+objective_id+', '+outcome_id+' )'
452
+            }).html('Delete All');
453
+            div_btn_group.append(div_btn);
454
+            div_col.append(div_btn_group);
455
+            div_row.append('<br><br>');
456
+
457
+            return div_row;
458
+        }
459
+
460
+        function showDeleteAllProgram(program_id, objective_id,outcome_id){
461
+            $(wr+'_title').html("Are you sure you want to remove all criterion paring?")
462
+            $(wr+"_delete").attr('onclick', 'postDeleteAll('+program_id+' ,'+outcome_id+' ,'+objective_id+'); $("'+wr+'").modal("hide") ');
463
+            $(wr+'_body').html("<p>You are about to detach <strong>All criteria from this program and objective</strong> </p>")
464
+            $(wr).modal('show');
465
+        }
466
+
467
+        function postDeleteAll(program_id,outcome_id, objective_id){
468
+            $.post(
469
+                "{{URL::action('Objective2Controller@postDeleteAll')}}",
470
+                {
471
+                    program_id:program_id,
472
+                    outcome_id:outcome_id,
473
+                    objective_id:objective_id
474
+                },
475
+                function(message){
476
+
477
+                    if(message == "200"){
478
+                        options = $("#program-"+program_id).find('select.selectpicker').html();
479
+                        
480
+                        $("#program-"+program_id).children('.removable_div').remove();
481
+                        addSelect("#program-"+program_id, options);
482
+                        //$('#program-'+program_id).children('.button-delete').after(select);
483
+                        //select.find('select').val(0);
484
+                        //$('.selectpicker').selectpicker('refresh');
485
+                        
486
+
487
+                    }
488
+
489
+                }
490
+            )
491
+        }
492
+
427 493
     
428 494
 
429 495
         function fetchCriteria(a){
@@ -465,6 +531,10 @@
465 531
                             "value":program.id
466 532
                         }).html(program.name)
467 533
 
534
+                        prog_div.append(createDeleteAllButton(program, outcome_id, objective_id));
535
+
536
+                        
537
+
468 538
                         program_select.append(program_option);
469 539
                         
470 540
 
@@ -604,7 +674,9 @@
604 674
                 removable_div = $(button).parent().parent().clone();
605 675
                 $(button).parent().parent().remove();
606 676
                 if(program_div.children('.removable_div').length === 0){
607
-                   addSelect('#'+program_div.attr('id'), options);
677
+                //program_div.children('.button-delete').after(createSelectForModal( options));
678
+                          
679
+                 addSelect('#'+program_div.attr('id'), options);
608 680
                 }
609 681
                 
610 682
                 //createSelectForModal(options);
@@ -646,7 +718,7 @@
646 718
             $(program_div_id).children(".removable_div").last().after(createSelectForModal(options));
647 719
             }
648 720
             else{
649
-                $(program_div_id).prepend(createSelectForModal(last_options))
721
+                $(program_div_id).children('.button-delete').after(createSelectForModal(last_options))
650 722
             }
651 723
             options = $(program_div_id).children('.removable_div').first().find('select.criteria_select').html();
652 724
             

+ 211
- 3
app/views/global/view-three-year-plan.blade.php Переглянути файл

@@ -252,16 +252,19 @@
252 252
                                 <div class="select-course-selection-0" style="margin-left:30px;">
253 253
                                     <div class="objective-selector-0">
254 254
                                         <label for="">OBJECTIVE TEMP</label>
255
-                                        <select class="select-0" name="" style="width:100%;max-width:55%;">
255
+                                        <select class="select-0"  name="" style="width:100%;max-width:55%;">
256 256
                                             <option class="default-option" value="nothing_selected">Select a course</option>
257 257
                                         </select>
258 258
                                         <button class="btn btn-md btn-primary delete-selection-0"
259 259
                                             style="margin:5px; "><span></span> X</button>
260 260
                                     </div>
261 261
                                     <div class="clone-objective-course-select-0">
262
+                                        <div class = 'btn-group'>
262 263
                                         <button class="btn btn-md btn-secondary add-objective-course"
263 264
                                             style="margin:5px;"><span class="glyphicon glyphicon-plus"></span> Choose more
264 265
                                             Courses</button>
266
+                                        <button class = 'btn btn-md btn-secondary copy-objective-button'  onclick="showParingObjectiveModal(this)" style="margin:5px;">Copy Courses to each Objective</button>
267
+                                        </div>
265 268
                                     </div>
266 269
                                 </div>
267 270
                             </div>
@@ -326,9 +329,206 @@
326 329
                 </div>
327 330
             </div>
328 331
         </div>
332
+        <div id="pairingModal" class="modal fade" tabindex="-1" data-criterion-id="0">
333
+            <div class="modal-dialog">
334
+                <div class="modal-content">
335
+                    <div class="modal-header" >
336
+                        <h5 class="modal-title" id = "pairingModalTitle">Would you like to pair this </h5>
337
+                        <button type="button" class="close" data-dismiss="modal">&times;</button>
338
+                    </div>
339
+                    <div class="modal-body"  id = 'pairingModalBody'>
340
+                    
341
+
342
+                    </div>
343
+                    <div class="modal-footer">
344
+                       
345
+                        <button type="button" class="btn btn-secondary" data-dismiss="modal" >cancel</button>
346
+                        <button type="button" id='pairingModalSubmitButton' class="btn btn-primary" data-dismiss="modal" onclick = 'pairEverything()' >Ok</button>
347
+                        
348
+                    </div>
349
+                </div>
350
+            </div>
351
+        </div>
329 352
 
330 353
     </div>
354
+
331 355
     <script>
356
+
357
+        function fetchPairingArraysForCourses(select_semester_selector, out_sem_obj_course_array, course_ids, outcome_id){
358
+
359
+            dict_to_send = {};
360
+            //always the same
361
+            
362
+
363
+            
364
+
365
+            dict_to_send['este_semestre']=  returnArrayReadyPerSelector(select_semester_selector, outcome_id, course_ids);
366
+
367
+            //array_por_semestre = [];
368
+            dict_to_send['por_semestre'] =[];
369
+
370
+
371
+            select_semester_selector.parent().children('.semester-course-selection').each(function(ind, div){
372
+                dict_to_send['por_semestre'].push(returnArrayReadyPerSelector(div, outcome_id, course_ids));
373
+            });
374
+
375
+            //dict_to_send['por_semestre'] = array_por_semestre;
376
+            return JSON.stringify(dict_to_send) ;
377
+
378
+        }
379
+        function returnArrayReadyPerSelector(selector, outcome_id, course_ids){
380
+                array_to_return =[];
381
+                semester_id = $(selector).data('semester-id');
382
+                $(selector).children("div.select-course-selection").each(function(ind, div){
383
+                    var objective_id = $(div).data('objective-id');
384
+                    $.each(course_ids, function(ind, course_id){
385
+                        array_to_return.push([outcome_id,semester_id,objective_id, course_id ])
386
+                    })
387
+                });
388
+            
389
+                return array_to_return;
390
+            }
391
+  
392
+        
393
+
394
+        function showParingObjectiveModal(button){
395
+            modal = "#pairingModal"
396
+
397
+            
398
+
399
+ 
400
+            is_obj = false;
401
+            if($(button).html()=="Copy Courses to each Objective"){
402
+                $(modal+'Title').html("Would you like to pair these Courses to each Objective in this Outcome");
403
+                $(modal+'Body').html(
404
+                "<label> Please select if you would like to pair these courses on this semester only or on each semester of this Outcome</label>"
405
+                );
406
+                select_semester = $("<select>",{
407
+                    'class':'selectpicker form-control',
408
+                    'id':'selectPorSemestre'
409
+                });
410
+                option = $("<option>", {
411
+                    'value': 'por_semestre'
412
+                }).html("For each Semester and Objective in this Outcome")
413
+
414
+                select_semester.append(option);
415
+                option = $("<option>", {
416
+                    'value': 'este_semestre'
417
+                }).html("For each Objective in this Semester and Outcome");
418
+                select_semester.append(option);
419
+                
420
+                $(modal+'Body').append(select_semester);
421
+                $('.selectpicker').selectpicker('refresh');
422
+               
423
+                }
424
+            else{
425
+                $(modal+'Title').html("Would you like to pair these Objective to each Semester in this Outcome");
426
+                $(modal+'Body').html("This action will pair these Objectives to each Semester of this Outcome.<br> This action is reversable")
427
+
428
+                is_obj = true;
429
+
430
+            }
431
+            select_course_selector = $(button).parent().parent().parent();
432
+            objective_selectors= select_course_selector.find("div:not([style*='display: none'])");
433
+            selects = objective_selectors.find('select');
434
+            
435
+
436
+            array_to_send = [];
437
+
438
+            var semester_id;
439
+            var outcome_id;
440
+            var objectives_ids = [];
441
+            var course_ids = [];
442
+            $.each(selects, function(ind, select){
443
+                splited = $(select).val().split('-');
444
+                semester_id = splited[1];
445
+                outcome_id = splited[0];
446
+                objectives_ids.push(splited[2]);
447
+                if(!is_obj){
448
+                    course_ids.push(splited[3]);
449
+                }
450
+
451
+                array_to_send.push(splited);
452
+            })
453
+
454
+            if(!is_obj){
455
+
456
+                two_possible_arrays = fetchPairingArraysForCourses(select_course_selector.parent(), array_to_send, course_ids, outcome_id);
457
+
458
+
459
+            }
460
+
461
+            else{
462
+                whole_outcome_div = select_course_selector.parent().parent();
463
+            whole_outcome_div.children('div.semester-course-selection').each(function(ind, div){
464
+                if($(div).data('semester-id')== semester_id){
465
+                    return;
466
+                }
467
+                
468
+                    div_semester = $(div).data('semester-id');
469
+                $.each(objectives_ids, function(ind, obj){
470
+                    array_to_send.push([outcome_id, div_semester, obj]);
471
+                })
472
+                
473
+                
474
+            })
475
+
476
+            }
477
+
478
+            if($(button).html()=="Copy Courses to each Objective"){
479
+                $(modal+"SubmitButton").attr('onclick', 'pairEveryCourse('+two_possible_arrays+')');
480
+       
481
+            }
482
+            else{
483
+                $(modal+"SubmitButton").attr('onclick', 'pairEveryObjective(['+array_to_send.toString()+'])')
484
+       
485
+            }
486
+
487
+            
488
+
489
+
490
+            $(modal).modal('show');
491
+
492
+        }
493
+
494
+        function pairEveryCourse(two_possible_arrays){
495
+           // two_possible_arrays = JSON.parse(two_possible_arrays);
496
+
497
+            pair_array = two_possible_arrays[$('#selectPorSemestre').val()];
498
+
499
+            var typ_id = $('#table-cycles').data('typ-id');
500
+            $.post(
501
+                "{{URL::action('ThreeYearPlanController@pairEveryCourse')}}", {
502
+                    pairing_array:pair_array,
503
+                    typ_id:typ_id,
504
+                    program_id:{{$program_id}},
505
+                    type_of_work: $('#selectPorSemestre').val()
506
+                },
507
+                function(data){
508
+                    if(data==200)
509
+                    $(".go-to-3").trigger('click');
510
+                }
511
+            )
512
+        }
513
+        function pairEveryObjective(selected_objectives){
514
+
515
+            var typ_id = $('#table-cycles').data('typ-id');
516
+            $.post(
517
+                "{{URL::action('ThreeYearPlanController@pairEveryObjective')}}",
518
+                {
519
+                    selected_objectives:selected_objectives,
520
+                    typ_id: typ_id,
521
+                    program_id:{{$program_id}}
522
+                },
523
+                function(data){
524
+                    if(data ==200){
525
+                        $(".go-to-2").trigger('click');
526
+                    }
527
+                   
528
+
529
+                }
530
+            )
531
+        }
332 532
         $(document).ready(function() {
333 533
             // --------------------------------------------------------------------------
334 534
             // Page load
@@ -656,6 +856,7 @@
656 856
             window.scrollTo(0, 0);
657 857
             $(".panel-body").hide();
658 858
             $("#section2").show();
859
+            
659 860
         });
660 861
 
661 862
 
@@ -716,6 +917,7 @@
716 917
 
717 918
                             var select_area = $('.semester-course-selection-0').clone(true);
718 919
                             select_area.attr('class', 'semester-course-selection');
920
+                            select_area.attr('data-semester-id', semester_id);
719 921
                             select_area.attr('style', ' ');
720 922
                             select_area.find('.semester-label-course-selection-0').html(
721 923
                                 semester_name + "'s Objectives");
@@ -725,6 +927,8 @@
725 927
                             select_area.find('.add-objective-course').html(
726 928
                                 '<span class="glyphicon glyphicon-plus"></span> Choose more Objectives'
727 929
                             );
930
+                            select_area.find('.copy-objective-button').html('Copy Objectives to each Semester in Outcome');
931
+
728 932
 
729 933
                             if (semester.available_objectives.length != 0) {
730 934
                                 select_area.find('.objective-selector-0 label').hide();
@@ -807,16 +1011,17 @@
807 1011
 
808 1012
         // in section 2 and 3, add selects for choosing more objectives and courses, respectively
809 1013
         $('.add-objective-course').on('click', function(e) {
810
-            var new_select = $(this).parent().parent().find('.objective-selector-0').clone(true);
1014
+            var new_select = $(this).parent().parent().parent().find('.objective-selector-0').clone(true);
811 1015
             new_select.attr('class', 'objective-selector');
812 1016
             new_select.show();
813 1017
             $(this).parent().before(new_select);
1018
+            //$('.selectpicker').selectpicker('refresh')
814 1019
         });
815 1020
 
816 1021
 
817 1022
         // go to section 3
818 1023
         $('.go-to-3').on('click', function(e) {
819
-            window.scrollTo(0, 0);
1024
+            //window.scrollTo(0, 0);
820 1025
             $(".panel-body").hide();;
821 1026
             $("#section3").show();;
822 1027
 
@@ -853,6 +1058,7 @@
853 1058
 
854 1059
                             var select_area = $('.semester-course-selection-0').clone(true);
855 1060
                             select_area.attr('class', 'semester-course-selection');
1061
+                            select_area.attr('data-semester-id', semester_id);
856 1062
                             select_area.attr('style', ' ');
857 1063
                             select_area.find('.semester-label-course-selection-0').html(
858 1064
                                 semester_name);
@@ -864,6 +1070,7 @@
864 1070
                                 var new_select = select_area.find(
865 1071
                                     '.select-course-selection-0').clone(true);
866 1072
                                 new_select.attr('class', 'select-course-selection');
1073
+                                new_select.attr('data-objective-id', objective_id);
867 1074
                                 new_select.find('label').html('');
868 1075
                                 new_select.find('.objective-selector-0').before(
869 1076
                                     '<p>Objective: <b>' + objective_text +
@@ -945,6 +1152,7 @@
945 1152
                         $('.courses-section').append(area);
946 1153
 
947 1154
                     });
1155
+                    //$('.selectpicker').selectpicker('refresh');
948 1156
                     //$('.objective-selector').children('.delete-selection-0').css("margin:5px; display:block;");
949 1157
                 }
950 1158
             );

+ 6
- 4
app/views/local/managers/admins/assign_other_programs.blade.php Переглянути файл

@@ -19,7 +19,7 @@
19 19
                     <!-- Program -->
20 20
                     <div class="form-group">
21 21
                         {{ Form::label('program', 'Select Program to pair other Program Courses\'') }}
22
-                        <select id="program" name="program" class="form-control selectpicker">
22
+                        <select id="program" name="program" class="form-control selectpicker" data-live-search= 'true'>
23 23
                             
24 24
                             @foreach ($programs as $program)
25 25
                                 @if (Input::old('program') != $program->id)
@@ -35,7 +35,7 @@
35 35
 
36 36
                     <div class="form-group" id = "other_program_div">
37 37
                         {{ Form::label('program', 'Choose other program') }}
38
-                        <select id="other_program_0" name="other_program[]" class="form-control selectpicker">
38
+                        <select id="other_program_0" name="other_program[]" class="form-control selectpicker" data-live-search="true">
39 39
                             
40 40
                             @foreach ($programs as $program)
41 41
                                 @if (Input::old('program') != $program->id)
@@ -97,7 +97,7 @@
97 97
                     <div class = "form-group">
98 98
                         {{Form::label('select-program-edit', "Edit Program Courses' Pairing")}}
99 99
                         <select id = "select-program-edit" name = "program" class ='form-control selectpicker'
100
-                        onchange = "fetchProgramPairing('#select-program-edit')">
100
+                        onchange = "fetchProgramPairing('#select-program-edit')" data-live-search="true">
101 101
                         @foreach ($programs as $program)
102 102
                         @if (Input::old('program') != $program->id)
103 103
                             <option value="{{ $program->id }}">{{ $program->name }}
@@ -113,7 +113,7 @@
113 113
 
114 114
                     <div class="form-group" id = "other_program_div_edit">
115 115
                         {{ Form::label('program', 'Choose other program') }}
116
-                        <select id="program-edit" name="other_program[]" class="form-control selectpicker">
116
+                        <select id="program-edit" name="other_program[]" class="form-control selectpicker" data-live-search="true">
117 117
                             <option value="0">Nothing Selected</option>
118 118
                             @foreach ($programs as $program)
119 119
                                 @if (Input::old('program') != $program->id)
@@ -185,7 +185,9 @@
185 185
             })
186 186
             select = $("<select>", {
187 187
                 'name': "other_program[]",
188
+                'data-live-search': 'true',
188 189
                 'class':'form-control selectpicker ' 
190
+                
189 191
             }).html(options);
190 192
 
191 193
             select.appendTo(div_select)

+ 6
- 6
app/views/local/managers/admins/overview2.blade.php Переглянути файл

@@ -179,7 +179,7 @@
179 179
                         <div class="category">
180 180
                             <label for="is_graduate">Level</label>
181 181
                             <div class="select">
182
-                                <select class="selectpicker" name="is_graduate" id="is_graduate">
182
+                                <select class="selectpicker" data-live-search='true' name="is_graduate" id="is_graduate">
183 183
                                     <option value="0" selected="selected">Undergradute</option>
184 184
                                     <option value="1">Graduate</option>
185 185
                                 </select>
@@ -190,7 +190,7 @@
190 190
                         <div class="category">
191 191
                             <label for="school">School</label>
192 192
                             <div class="select">
193
-                                <select multiple class="selectpicker" name="school" id="school">
193
+                                <select multiple class="selectpicker" data-live-search="true" name="school" id="school">
194 194
                                     <option value="0" selected="selected">All</option>
195 195
                                     @foreach ($filters['school'] as $school)
196 196
                                         <option value="{{ $school->id }}">{{ $school->name }}</option>
@@ -201,7 +201,7 @@
201 201
                         <div class="category">
202 202
                             <label for="program">Academic Program</label>
203 203
                             <div class="select">
204
-                                <select multiple class="selectpicker" name="program" id="program">
204
+                                <select multiple class="selectpicker" data-live-search="true" name="program" id="program">
205 205
                                     <option value="0" selected="selected">All</option>
206 206
                                     @foreach ($filters['program'] as $program)
207 207
                                         <option value="{{ $program->id }}">{{ $program->name }}</option>
@@ -214,7 +214,7 @@
214 214
                         <div class="category">
215 215
                             <label for="semester">Semester</label>
216 216
                             <div class="select">
217
-                                <select multiple class="selectpicker" name="semester" id="semester">
217
+                                <select multiple class="selectpicker" data-live-search="true" name="semester" id="semester">
218 218
                                     <option value="0" selected="selected">All</option>
219 219
                                     @foreach ($filters['semester'] as $semester)
220 220
                                         <option value="{{ $semester->id }}">{{ $semester->name }}</option>
@@ -225,7 +225,7 @@
225 225
                         <div class="category">
226 226
                             <label for="year">Academic Year</label>
227 227
                             <div class="select">
228
-                                <select multiple class="selectpicker" name="year" id="year">
228
+                                <select multiple class="selectpicker" data-live-search = 'true'name="year" id="year">
229 229
                                     <option value="0" selected="selected">All</option>
230 230
                                     @foreach ($filters['year'] as $year)
231 231
                                         <option value="{{ $year->id }}">{{ $year->start }}</option>
@@ -236,7 +236,7 @@
236 236
                         <div class="category">
237 237
                             <label for="outcome">Learning Outcomes</label>
238 238
                             <div class="select">
239
-                                <select multiple class="selectpicker" name="outcome" id="outcome">
239
+                                <select multiple class="selectpicker" data-live-search="true" name="outcome" id="outcome">
240 240
                                     <option value="0" selected="selected">All</option>
241 241
                                     @foreach ($filters['outcome'] as $outcome)
242 242
                                         <option value="{{ $outcome->id }}">{{ $outcome->name }}</option>

+ 1
- 1
app/views/local/managers/admins/show-typ-program.blade.php Переглянути файл

@@ -18,7 +18,7 @@
18 18
         </div>
19 19
 
20 20
         <div class='col-md-12'>
21
-            <select id ='typ' class="form-control selectpicker" onchange="fetchSubmit('#typ')">
21
+            <select id ='typ' class="form-control selectpicker" data-live-search = 'true' onchange="fetchSubmit('#typ')">
22 22
                 @foreach($typ as $t)
23 23
                 <option value = {{$t->id}}> Cycle {{$t->year_start}}-{{$t->year_end}}  </option>
24 24
                 @endforeach

+ 10
- 10
app/views/local/managers/admins/transformativeAction.blade.php Переглянути файл

@@ -43,7 +43,7 @@
43 43
                     <label>Courses being Transformed by the Action</label>
44 44
                     <div class="" id="">
45 45
                         <div class="form-group col-md-11">
46
-                            <select name="courseid" class="form-control createCourses selectpicker">
46
+                            <select name="courseid" class="form-control createCourses selectpicker" data-live-search = 'true'>
47 47
                                 @foreach ($courses_create as $course)
48 48
                                     <option value="({{ $course->code }},{{ $course->number }})">
49 49
                                         {{ $course->code }}{{ $course->number }} {{ $course->name }}</option>
@@ -63,7 +63,7 @@
63 63
 
64 64
                     <div class="form-group" id='createOutcome'>
65 65
                         <label>Outcome </label>
66
-                        <select name="outcome" class="form-control selectpicker">
66
+                        <select name="outcome" class="form-control selectpicker" data-live-search="true">
67 67
                             @foreach ($outcomes as $outcome)
68 68
                                 <option value="{{ $outcome->id }}">{{ $outcome->name }}</option>
69 69
                             @endforeach
@@ -90,7 +90,7 @@
90 90
                     <br>
91 91
                     <div class="form-group">
92 92
                         <label>Type of Transformative Action</label>
93
-                        <select name='type_of_ta' class="form-control selectpicker">
93
+                        <select name='type_of_ta' class="form-control selectpicker" data-live-search="true">
94 94
                             @foreach ($types as $type)
95 95
                                 <option value='{{ $type->type_of_TA }}'>{{ $type->type_of_TA }}</option>
96 96
                             @endforeach
@@ -254,7 +254,7 @@
254 254
                         <div class="">
255 255
                             <div class="">
256 256
                                 <label>Professor that created the TA</label>
257
-                                <select class="form-control filterProfessor selectpicker">
257
+                                <select class="form-control filterProfessor selectpicker" data-live-search="true">
258 258
                                     <option value="0">Show All</option>
259 259
                                     @foreach ($professor_filter_editPanel as $user)
260 260
                                         <option value="{{ $user->id }}">Prof. {{ $user->first_name }}
@@ -265,7 +265,7 @@
265 265
                             <br>
266 266
                             <div class="">
267 267
                                 <label>Course evaluated by an Objective of the TA</label>
268
-                                <select class="form-control filterCourse selectpicker">
268
+                                <select class="form-control filterCourse selectpicker" data-live-search="true">
269 269
                                     <option value="0">Show All</option>
270 270
                                     @foreach ($course_filter_editPanel as $course)
271 271
                                         <option value="({{ $course->code }},{{ $course->number }})">
@@ -276,7 +276,7 @@
276 276
                             <br>
277 277
                             <div class="">
278 278
                                 <label>Outcome of the TA</label>
279
-                                <select class="form-control filterOutcome selectpicker">
279
+                                <select class="form-control filterOutcome selectpicker" data-live-search="true">
280 280
                                     <option value="0">Show All</option>
281 281
                                     @foreach ($outcome_filter_editPanel as $outcome)
282 282
                                         <option value="{{ $outcome->id }}">{{ $outcome->name }}</option>
@@ -292,7 +292,7 @@
292 292
                     <div>
293 293
                         <div class="form-group col-md-12">
294 294
                             <label>Select Transformative Action</label>
295
-                            <select name="ta" class="form-control SelectTA selectpicker" id='editSelectTA'>
295
+                            <select name="ta" class="form-control SelectTA selectpicker" data-live-search="true" id='editSelectTA'>
296 296
                                 @if (count($ta_edit_panel) == 0)
297 297
                                     <option value="0">No TAs available</option>
298 298
                                 @else
@@ -318,7 +318,7 @@
318 318
                     <div class="form-group"> </div>
319 319
                     <div class="form-group" id='editApproval'>
320 320
                         <label>Availability</label>
321
-                        <select name="approval" class="form-control selectpicker">
321
+                        <select name="approval" class="form-control selectpicker" data-live-search="true">
322 322
                             <option value="1">Recommended</option>
323 323
                             <option value="0">To be implemented</option>
324 324
                         </select>
@@ -327,7 +327,7 @@
327 327
                     <label>Associated Courses</label>
328 328
                     <div class="editCourses">
329 329
                         <div class="form-group col-md-11 editCourse">
330
-                            <select name="courseid" id="edit_course" class="form-control selectpicker">
330
+                            <select name="courseid" id="edit_course" class="form-control selectpicker" data-live-search="true">
331 331
                                 @foreach ($courses_create as $course)
332 332
                                     <option value="({{ $course->code }},{{ $course->number }})">
333 333
                                         {{ $course->code }}{{ $course->number }} {{ $course->name }}</option>
@@ -367,7 +367,7 @@
367 367
                     <br><br>
368 368
                     <div class="form-group">
369 369
                         <label>Type of Transformative Action</label>
370
-                        <select name='type_of_ta' class="form-control selectpicker">
370
+                        <select name='type_of_ta' class="form-control selectpicker" data-live-search="true">
371 371
                             @foreach ($types as $type)
372 372
                                 <option value='{{ $type->type_of_TA }}'>{{ $type->type_of_TA }}</option>
373 373
                             @endforeach

+ 101
- 1
app/views/local/managers/shared/annual-plans.blade.php Переглянути файл

@@ -193,7 +193,102 @@
193 193
         </div><!-- /.modal-dialog -->
194 194
     </div><!-- /.modal -->
195 195
 
196
+
197
+    <div class="modal fade" id="modal-template-criteria">
198
+        <div class="modal-dialog modal-lg">
199
+            <div class="modal-content">
200
+                <div class="modal-header">
201
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
202
+                            aria-hidden="true">&times;</span></button>
203
+                    <h3 class="modal-title">Select Rubric/Template to export it's criteria</h3>
204
+                </div>
205
+                <div class="modal-body" id = 'modal-template-criteria-body'>
206
+
207
+
208
+
209
+                </div>
210
+                <div class="modal-footer">
211
+                    <button type="button" id ='exportButton' class="btn btn-primary" onclick='exportCriteriaFromTemplate()'>Export Criteria</button>
212
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
213
+
214
+
215
+                </div>
216
+            </div><!-- /.modal-content -->
217
+        </div><!-- /.modal-dialog -->
218
+    </div><!-- /.modal -->
219
+
220
+
221
+
222
+
196 223
     <script>
224
+        //Export functionality begin///////////////////////////////////////////////////////////
225
+        
226
+        function selectRubricForCriteria(objective_id,outcome_id,program_id, typ_objective_id){
227
+            $.post(
228
+                "{{URL::action('AnnualPlansController@fetchTemplatesForCriteria')}}",
229
+                {
230
+                    objective_id:objective_id,
231
+                    outcome_id:outcome_id,
232
+                    program_id:program_id
233
+                },
234
+                function(templates){
235
+                    modal = '#modal-template-criteria';
236
+                    $(modal+'-body').html(' ');
237
+                    select = $('<select>', {
238
+                        'class':'selectpicker form-control',
239
+                        'data-live-search':'true',
240
+                        'id':'templateToExport'
241
+                    });
242
+
243
+                    options = "<option value ='0'>Nothing selected</option>";
244
+                    $.each(templates, function(ind, tem){
245
+                        options+= '<option value = "'+tem.id+'">'+tem.name+'</option>';
246
+                    });
247
+
248
+                    select.html(options);
249
+                    label = $("<label>", {
250
+                        'for':'templateToExport'
251
+                    }).html("Select a Rubric or Template");
252
+
253
+                    $(modal+'-body').append(label);
254
+                    $(modal+'-body').append(select);
255
+                    $(".selectpicker").selectpicker('refresh');
256
+                    $('#exportButton').attr('onclick', 'exportCriteriaFromTemplate('+typ_objective_id+', '+objective_id+', '+outcome_id+', '+program_id+')')
257
+                    $(modal).modal('show');
258
+                    
259
+
260
+                    
261
+                }
262
+            )
263
+        } 
264
+
265
+        function exportCriteriaFromTemplate(typ_objective_id, objective_id, outcome_id, program_id){
266
+
267
+            template_id = $('#templateToExport').val();
268
+            $.post(
269
+                "{{URL::action('AnnualPlansController@pairCriteriaFromTemplate')}}",
270
+                {
271
+                    typ_objective_id: typ_objective_id,
272
+                    template_id:template_id,
273
+                    outcome_id:outcome_id,
274
+                    program_id:program_id,
275
+                    objective_id:objective_id,
276
+                    annual_plan: $("#annual_plan").val()
277
+                },
278
+                function(result){
279
+                    if(result == 200){
280
+                        $('#modal-template-criteria').modal('hide');
281
+                        $('#allOutcomes').find('li.selected').trigger('click');
282
+                    }
283
+                }
284
+            )
285
+
286
+        }
287
+
288
+        //export function END
289
+        //
290
+        /////////////////////////////////////////////////////////////////////////////////////////////
291
+
197 292
         function nextChar(c) {
198 293
             return String.fromCharCode(c.charCodeAt(0) + 1);
199 294
         }
@@ -465,13 +560,17 @@
465 560
 
466 561
         }
467 562
 
563
+
468 564
         function fetchEverything(li) {
565
+            $('#allOutcomes').find('li').removeClass('selected');
469 566
             $('#close_button').click();
470 567
             var id = $(li).data('outcome-id');
471 568
             var name = $(li).data('outcome-name');
472 569
             var semester = $(li).data('semester-id');
473 570
             var annual_plan = $(li).data('annual-plan');
474 571
             var typ_semester_outcome_id = $(li).data('typ-semester-outcome-id');
572
+            var outcome_id = $(li).data('outcome-id');
573
+            $(li).addClass('selected');
475 574
             $('#expected-outcome').data('semester-id', semester);
476 575
             $('#typ_semester_outcome_id').val(typ_semester_outcome_id);
477 576
 
@@ -546,7 +645,7 @@
546 645
                             var criteriaHTML = '';
547 646
                             objectivesHTML += '<strong>' + nextLetter + '.    ' + objectives[objective]
548 647
                                 .text +
549
-                                '</strong></div>';
648
+                                '</strong></div><br><a onclick="selectRubricForCriteria('+objectives[objective].id+', '+outcome_id+','+{{ $program->id }}+', '+typ_objective_id+')">Select criteria from rubric</a>';
550 649
                             // courseshtml += "<strong>Objective "+nextLetter+"</strong>";
551 650
                             // courseshtml += '<ul>';
552 651
                             criteriaHTML += "<strong>Objective " + nextLetter + "</strong>";
@@ -930,6 +1029,7 @@
930 1029
                 'name': 'type_of_ta',
931 1030
                 'id': 'type_of_ta',
932 1031
                 'class': 'form-control selectpicker',
1032
+                'data-live-search':'true',
933 1033
                 'onchange': 'checkIfNew(this)'
934 1034
             }).html(GlobalTransCategories);
935 1035
 

+ 6
- 3
app/views/local/managers/shared/annual_report.blade.php Переглянути файл

@@ -21,7 +21,7 @@
21 21
 
22 22
     <div class="row">
23 23
         <div class="col-md-3">
24
-            <select class="form-control selectpicker" id="annual_plan" onchange="fetchInfo('annual_plan')">
24
+            <select class="form-control selectpicker" data-live-search="true" id="annual_plan" onchange="fetchInfo('annual_plan')">
25 25
                 <option value='0'> Nothing Selected</option>
26 26
                 @foreach ($annual_plans as $an_plan)
27 27
                     <option value={{ $an_plan->annual_id }}>Plan {{ $an_plan->academic_year }}</option>
@@ -571,6 +571,7 @@
571 571
                 'name': 'type_of_ta',
572 572
                 'id': 'type_of_ta_of_' + typ_semester_course_id,
573 573
                 'class': 'form-control selectpicker',
574
+                'data-live-search':'true',
574 575
                 'onchange': 'checkIfNew(this)'
575 576
             }).html(GlobalTransCategories);
576 577
 
@@ -599,7 +600,8 @@
599 600
             selectpicker_for_semesters = $('<select>', {
600 601
                 'name': 'selected_semesters_for_' + typ_semester_course_id + '_[]',
601 602
                 'id': 'selected_semester_first_for_' + typ_semester_course_id,
602
-                'class': 'form-control selectpicker'
603
+                'class': 'form-control selectpicker',
604
+                'data-live-search':'true',
603 605
             });
604 606
             options_for_semesters = '<option value = "0">Nothing Selected</option>';
605 607
 
@@ -902,7 +904,8 @@
902 904
             newselect = $('<select>', {
903 905
                 'name': 'selected_semesters_for_' + typ_semester_course_id + '_[]',
904 906
                 //'id':'selected_semester_first_for_'+typ_semester_course_id,
905
-                'class': 'form-control selectpicker'
907
+                'class': 'form-control selectpicker',
908
+                'data-live-search':'true',
906 909
             }).html(first_select_options);
907 910
 
908 911
             span_group = $("<span>", {

+ 11
- 11
app/views/local/managers/shared/course_edit.blade.php Переглянути файл

@@ -36,7 +36,7 @@
36 36
                     <!-- Program -->
37 37
                     <div class="form-group">
38 38
                         {{ Form::label('program', 'Program') }}
39
-                        <select id="program" name="program" class="form-control selectpicker">
39
+                        <select id="program" name="program" class="form-control selectpicker" data-live-search = 'true'>
40 40
                             
41 41
                             @foreach ($programs as $program)
42 42
                                 @if (Input::old('program') != $program->id)
@@ -52,7 +52,7 @@
52 52
 
53 53
                     <div class="form-group">
54 54
                         {{ Form::label('user_id', 'Professor') }}
55
-                        <select id="professor_id" name="professor_id" class="form-control selectpicker">
55
+                        <select id="professor_id" name="professor_id" class="form-control selectpicker" data-live-search = 'true'>
56 56
                              @foreach ($professors as $professor)
57 57
                                  @if (Input::old('professor_id') != $professor->id )
58 58
                                     <option value="{{$professor->id}}">{{ $professor->surnames }}, {{$professor->first_name}}
@@ -71,7 +71,7 @@
71 71
                     <div class ="form-group">
72 72
                         {{ Form::label("semester_id",'Semester')}}
73 73
 
74
-                        <select id ="semester_id" name="semester_id" class="form-control selectpicker">
74
+                        <select id ="semester_id" name="semester_id" class="form-control selectpicker" data-live-search = 'true'>
75 75
                             @foreach ($semesters as $semester)
76 76
                                 @if (Input::old('semester_id') != $semester->id)
77 77
                                     <option value="{{ $semester->id }}">{{ $semester->name }}</option>
@@ -86,7 +86,7 @@
86 86
                     <div class = "form-group">
87 87
                         {{Form::label('modality','Course Modality')}}
88 88
 
89
-                        <select id="modality" name = "modality" class= "form-control selectpicker">
89
+                        <select id="modality" name = "modality" class= "form-control selectpicker" data-live-search = 'true'>
90 90
                             @foreach($modalities as $modality)
91 91
                                 @if (Input::old('modality') != $modality)
92 92
                                     <option value="{{ $modality }}">{{ $modality }}</option>
@@ -152,7 +152,7 @@
152 152
                         <br>
153 153
                         <div class="form-group">
154 154
                             {{ Form::label('program_id2', 'Associated Program') }}
155
-                            <select id='select-program' class="form-control selectpicker"
155
+                            <select id='select-program' class="form-control selectpicker" data-live-search = 'true'
156 156
                             onchange='fetchCourses("#select-program", "#select-semester")'>
157 157
 
158 158
                                 @foreach ($programs as $program)
@@ -165,7 +165,7 @@
165 165
                         
166 166
                         <div class="form-group">
167 167
                             {{ Form::label('semester_assoc', 'Course Semester') }}
168
-                            <select id='select-semester' class="form-control selectpicker"
168
+                            <select id='select-semester' class="form-control selectpicker" data-live-search = 'true'
169 169
                                 onchange='fetchCourses("#select-program", "#select-semester")'>
170 170
 
171 171
                                 @foreach ($semesters as $semester)
@@ -180,7 +180,7 @@
180 180
                     <hr>
181 181
                     <div class = "form-group">
182 182
                         {{Form::label('select_course', "Course")}}
183
-                        <select id = "select-course" name = "select-course" class ='form-control selectpicker'
183
+                        <select id = "select-course" name = "select-course" class ='form-control selectpicker' data-live-search = 'true'
184 184
                         onchange = "fetchCourseInfo('#select-course')">
185 185
                             
186 186
 
@@ -210,7 +210,7 @@
210 210
                     <!-- Program -->
211 211
                     <div class="form-group">
212 212
                         {{ Form::label('program', 'Program') }}
213
-                        <select id="edit_program" name="program" class="form-control selectpicker">
213
+                        <select id="edit_program" name="program" class="form-control selectpicker" data-live-search = 'true'>
214 214
                             
215 215
                             @foreach ($programs as $program)
216 216
                                 @if (Input::old('program') != $program->id)
@@ -226,7 +226,7 @@
226 226
 
227 227
                     <div class="form-group">
228 228
                         {{ Form::label('user_id', 'Professor') }}
229
-                        <select id="edit_professor_id" name="professor_id" class="form-control selectpicker">
229
+                        <select id="edit_professor_id" name="professor_id" class="form-control selectpicker" data-live-search = 'true'>
230 230
                              @foreach ($professors as $professor)
231 231
                                  @if (Input::old('professor_id') != $professor->id )
232 232
                                     <option value="{{$professor->id}}">{{ $professor->surnames }}, {{$professor->first_name}}
@@ -245,7 +245,7 @@
245 245
                     <div class ="form-group">
246 246
                         {{ Form::label("semester_id",'Semester')}}
247 247
 
248
-                        <select id ="edit_semester_id" name="semester_id" class="form-control selectpicker">
248
+                        <select id ="edit_semester_id" name="semester_id" class="form-control selectpicker" data-live-search = 'true'>
249 249
                             @foreach ($semesters as $semester)
250 250
                                 @if (Input::old('semester_prof') != $semester->id)
251 251
                                     <option value="{{ $semester->id }}">{{ $semester->name }}</option>
@@ -259,7 +259,7 @@
259 259
                     <div class = "form-group">
260 260
                         {{Form::label('modality','Course Modality')}}
261 261
 
262
-                        <select id="edit_modality" name = "modality" class= "form-control selectpicker">
262
+                        <select id="edit_modality" name = "modality" class= "form-control selectpicker" data-live-search = 'true'>
263 263
                             @foreach($modalities as $modality)
264 264
                                 @if (Input::old('modality') != $modality)
265 265
                                     <option value="{{ $modality }}">{{ $modality }}</option>

+ 9
- 9
app/views/local/managers/shared/criteria.blade.php Переглянути файл

@@ -26,13 +26,13 @@
26 26
                             <div class="form-group col-md-12 selectOutcome">
27 27
                                 <label>Outcome 1</label>
28 28
 
29
-                                {{ Form::select('outcome[]', $outcomes, reset($outcomes), ['class' => 'form-control selectpicker', 'id' => 'outcome0', 'onchange' => 'fetchObjectiveForSelect("outcome0", "objectiveGroupFor0")']) }}
29
+                                {{ Form::select('outcome[]', $outcomes, reset($outcomes), ['class' => 'form-control selectpicker', 'id' => 'outcome0', 'onchange' => 'fetchObjectiveForSelect("outcome0", "objectiveGroupFor0")', 'data-live-search'=>'true']) }}
30 30
                             </div>
31 31
 
32 32
                             <div id='objectiveGroupFor0' class='createObjective' data-value='1'>
33 33
                                 <div class="form-group col-md-11 selectObjective">
34 34
                                     <label>Associated Objectives for Outcome 1</label>
35
-                                    <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker"
35
+                                    <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker" data-live-search = 'true'
36 36
                                         onchange="visiblePrograms('allOutcomes')">
37 37
                                     </select>
38 38
 
@@ -102,7 +102,7 @@
102 102
                     </div>
103 103
                     <div class="form-group form_validation number_of_scales">
104 104
                         {{ Form::label('scales', 'Number of Scales') }}
105
-                        <select id="Num_scale" name="scales" class="form-control selectpicker"
105
+                        <select id="Num_scale" name="scales" class="form-control selectpicker" data-live-search="true"
106 106
                             onchange='numberOfScales("Num_scale", "Scales")'>
107 107
 
108 108
                         </select>
@@ -144,7 +144,7 @@
144 144
                     <div class="filterSection">
145 145
                         <div class="form-group">
146 146
                             {{ Form::label('program_id2', 'Associated Program') }}
147
-                            <select id='select-program' class="form-control selectpicker"
147
+                            <select id='select-program' class="form-control selectpicker" data-live-search="true"
148 148
                                 onchange='fetchAllCriterion("select-program", "assoc_outcomes_fetch")'>
149 149
 
150 150
                                 @foreach ($programs as $program)
@@ -156,7 +156,7 @@
156 156
                         </div>
157 157
                         <div class="form-group">
158 158
                             <label>Associated Outcome</label>
159
-                            {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class' => 'form-control selectpicker', 'id' => 'assoc_outcomes_fetch', 'onchange' => 'fetchAllCriterion("select-program", "assoc_outcomes_fetch")']) }}
159
+                            {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class' => 'form-control selectpicker','data-live-search'=>'true', 'id' => 'assoc_outcomes_fetch', 'onchange' => 'fetchAllCriterion("select-program", "assoc_outcomes_fetch")']) }}
160 160
 
161 161
                         </div>
162 162
                     </div>
@@ -164,7 +164,7 @@
164 164
 
165 165
                     <div class="form-group">
166 166
                         {{ Form::label('criterion_id', 'Criterion') }}
167
-                        <select id="select-criterion" name="id" class="form-control selectpicker"
167
+                        <select id="select-criterion" name="id" class="form-control selectpicker" data-live-search="true"
168 168
                             onchange='fetchCriterionForEditing()'>
169 169
 
170 170
                         </select>
@@ -174,14 +174,14 @@
174 174
                         <div id='assocOutcomeGroup0' class='createOutcome' data-value="1">
175 175
                             <div class="form-group col-md-12 selectOutcome">
176 176
                                 <label>Outcome 1</label>
177
-                                {{ Form::select('outcome[]', $outcomes, null, ['class' => 'form-control selectpicker', 'id' => 'assoc_outcome_0', 'onchange' => 'fetchObjectiveForSelect("assoc_outcome_0", "assoc_objectiveGroupFor0")']) }}
177
+                                {{ Form::select('outcome[]', $outcomes, null, ['class' => 'form-control selectpicker', 'data-live-search'=>'true', 'id' => 'assoc_outcome_0', 'onchange' => 'fetchObjectiveForSelect("assoc_outcome_0", "assoc_objectiveGroupFor0")']) }}
178 178
 
179 179
                             </div>
180 180
                             <div id='assoc_objectiveGroupFor0' class='createObjective' data-value="1">
181 181
                                 <div class="form-group col-md-11 selectObjective">
182 182
                                     <label>Associated Objectives for Outcome 1</label>
183 183
                                     <select id="assoc_objective_0_counter_1" name="objective[]"
184
-                                        class="form-control selectpicker" onchange="visiblePrograms('allAssocOutcomes')">
184
+                                        class="form-control selectpicker" data-live-search="true" onchange="visiblePrograms('allAssocOutcomes')">
185 185
                                         <option value="0">No associated objectives</option>
186 186
                                     </select>
187 187
 
@@ -271,7 +271,7 @@
271 271
 
272 272
                     <div class="form-group form_validation number_of_scales">
273 273
                         {{ Form::label('scales', 'Number of Scales') }}
274
-                        <select id="Num_assoc_scale" class="form-control selectpicker"
274
+                        <select id="Num_assoc_scale" class="form-control selectpicker" data-live-search="true"
275 275
                             onchange='numberOfAssoc("Num_assoc_scale", "Assoc_Scales")'>
276 276
 
277 277
                         </select>

+ 6
- 5
app/views/local/managers/shared/objectives.blade.php Переглянути файл

@@ -29,7 +29,7 @@
29 29
                         <div class="form-group col-md-11" id='outcomeForm'>
30 30
 
31 31
 
32
-                            <select id="outcome[0]" name="outcome[0]" class="form-control selectpicker createOutcome">
32
+                            <select id="outcome[0]" name="outcome[0]" data-live-search = 'true' class="form-control selectpicker createOutcome">
33 33
 
34 34
                                 @foreach ($outcomes as $outcome)
35 35
                                     <option value="{{ $outcome->id }}">
@@ -119,7 +119,7 @@
119 119
 
120 120
                         <div class="form-group">
121 121
                             {{ Form::label('program_id2', 'Associated Program') }}
122
-                            <select id='select-program' class="form-control selectpicker"
122
+                            <select id='select-program' class="form-control selectpicker" data-live-search="true"
123 123
                                 onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
124 124
                                 @foreach ($programs as $program)
125 125
                                     <option value='{{ $program->id }}' data-subtext="{{ $program->code }}">
@@ -130,7 +130,7 @@
130 130
                         <div class="form-group">
131 131
                             <label>Associated Learning Outcome</label>
132 132
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
133
-                            <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
133
+                            <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker" data-live-search="true"
134 134
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
135 135
                                 @foreach ($outcomes as $outcome)
136 136
                                     <option value="{{ $outcome->id }}">
@@ -148,7 +148,7 @@
148 148
 
149 149
                     <div class="form-group">
150 150
                         {{ Form::label('objective_id', 'Objectives') }}
151
-                        <select id="select-objective" name='id' class="form-control selectpicker">
151
+                        <select id="select-objective" name='id' class="form-control selectpicker" data-live-search="true">
152 152
                             @foreach ($objectives as $objective)
153 153
                                 <option value="{{ $objective->id }}"
154 154
                                     data-subtext="
@@ -173,7 +173,7 @@
173 173
 
174 174
                             <div id="message_to_disconnect"></div>
175 175
 
176
-                            <select id="assoc_outcome0" name="assoc_outcome[]" class="form-control selectpicker">
176
+                            <select id="assoc_outcome0" name="assoc_outcome[]" class="form-control selectpicker" data-live-search="true">
177 177
 
178 178
                                 @foreach ($outcomes as $outcome)
179 179
                                     <option value="{{ $outcome->id }}">
@@ -365,6 +365,7 @@
365 365
         function addOutcomeTest() {
366 366
             var $select = $('<select/>', {
367 367
                 'class': "selectpicker form-control createOutcome",
368
+                
368 369
                 'name': "outcome[" + counter.toString() + "]",
369 370
                 'data-live-search': 'true'
370 371
 

+ 10
- 10
app/views/local/managers/shared/rubrics.blade.php Переглянути файл

@@ -71,7 +71,7 @@
71 71
                 <form>
72 72
                     <div class="form-group">
73 73
                         <label>Select a template, or create your own rubric</label>
74
-                        <select id="select-template" class="form-control selectpicker">
74
+                        <select id="select-template" class="form-control selectpicker" data-live-search='true'>
75 75
                             <option data-template-id="0">Custom</option>
76 76
                             @foreach ($templates as $template)
77 77
                                 @if($template->school_id==NULL &&  $template->program_id==NULL)
@@ -99,7 +99,7 @@
99 99
                     @if(Auth::user()->role==1)
100 100
                     <div class="form-group">
101 101
                         <label>Select the School this rubric will be visible from</label>
102
-                        <select id="select-school" class="form-control selectpicker">
102
+                        <select id="select-school" class="form-control selectpicker" data-live-search='true'>
103 103
                             <option data-school-id="0">All</option>
104 104
                             @foreach ($schools as $school)
105 105
                             <option data-school-id="{{ $school->id }}">
@@ -114,7 +114,7 @@
114 114
                     @if(Auth::user()->role==1 || Auth::user()->role==2 || Auth::user()->role ==3)
115 115
                     <div class="form-group">
116 116
                         <label>Select the Program this rubric belongs to</label>
117
-                        <select id="select-program" class="form-control selectpicker">
117
+                        <select id="select-program" class="form-control selectpicker" data-live-search='true'>
118 118
                             <option data-program-id="0">All</option>
119 119
                             @foreach ($programs as $program)
120 120
                                 <option
@@ -137,7 +137,7 @@
137 137
                     <div class="form-group">
138 138
                         <!-- Select percentage. If there is a rubric, select the saved value -->
139 139
 
140
-                        <select id="expected_percentage" class="form-control selectpicker">
140
+                        <select id="expected_percentage" class="form-control selectpicker" data-live-search='true'>
141 141
                             @for($i = 50; $i <= 100; $i++)
142 142
                                 @if($i==70)
143 143
                                     <option selected="selected" value="{{ $i }}">{{ $i }}</option>
@@ -152,7 +152,7 @@
152 152
 
153 153
                         
154 154
                         <!-- Select points. If there is a rubric, select the saved value -->
155
-                        <select id="expected_points" class="form-control selectpicker">
155
+                        <select id="expected_points" class="form-control selectpicker" data-live-search='true'>
156 156
                             @for($i = 0; $i <= 8; $i++)
157 157
                                 @if($i==5)
158 158
                                     <option selected="selected" value="{{ $i }}">{{ $i }}</option>
@@ -195,7 +195,7 @@
195 195
             <form>
196 196
                 <div class="form-group">
197 197
                     <label>Select a Learning Outcome</label>
198
-                    <select id="select-outcome" class="form-control selectpicker" >
198
+                    <select id="select-outcome" class="form-control selectpicker" data-live-search='true' >
199 199
                         @foreach ($outcomes as $outcome)
200 200
                         <option data-outcome-id="{{ $outcome->id }}">{{ $outcome->name }}</option>
201 201
                         @endforeach
@@ -203,14 +203,14 @@
203 203
                 </div>
204 204
                 <div class="form-group">
205 205
                     <label>Select an Objective</label>
206
-                    <select id="select-objective" class="form-control selectpicker" >
206
+                    <select id="select-objective" class="form-control selectpicker" data-live-search='true' >
207 207
                         
208 208
                     </select>
209 209
                 </div>
210 210
 
211 211
                     <div class="form-group">
212 212
                         <label>Select the Maximum Score</label>
213
-                    <select id="max_score" class="form-control selectpicker">
213
+                    <select id="max_score" class="form-control selectpicker" data-live-search='true'>
214 214
                         @for($i = 1; $i <= 100; $i++)
215 215
                             @if($i==8)
216 216
                                 <option selected="selected" value="{{ $i }}">{{ $i }}</option>
@@ -224,7 +224,7 @@
224 224
                 </div>
225 225
                 <div class="form-group">
226 226
                     <label>Select the Type of Rubric</label>
227
-                <select id="number_of_scales" class="form-control selectpicker" >
227
+                <select id="number_of_scales" class="form-control selectpicker" data-live-search='true' >
228 228
                     @for($i = 1; $i <= 20; $i++)
229 229
                     @if(8%$i == 0)
230 230
                     @if($i==1)
@@ -261,7 +261,7 @@
261 261
 
262 262
                 <div class="form-group">
263 263
                     <label>Select a Criterion</label><span id="updated-text" class="text-success small">  updated</span>
264
-                    <select id="select-criterion" class="form-control selectpicker">
264
+                    <select id="select-criterion" class="form-control selectpicker" data-live-search='true'>
265 265
                     </select>
266 266
                 </div>
267 267
 

+ 10
- 10
app/views/local/managers/shared/rubrics_new.blade.php Переглянути файл

@@ -73,7 +73,7 @@
73 73
                 <form>
74 74
                     <div class="form-group">
75 75
                         <label>Select a template, or create your own rubric</label>
76
-                        <select id="select-template" class="form-control selectpicker">
76
+                        <select id="select-template" class="form-control selectpicker" data-live-search='true' data-live-search='true'>
77 77
                             <option data-template-id="0">Custom</option>
78 78
                             @foreach ($templates_dentro as $template)
79 79
                                 @if($template->school_id==NULL &&  $template->program_id==NULL)
@@ -127,7 +127,7 @@
127 127
                     @if(Auth::user()->role==1)
128 128
                     <div class="form-group">
129 129
                         <label>Select the School this rubric will be visible from</label>
130
-                        <select id="select-school" class="form-control selectpicker">
130
+                        <select id="select-school" class="form-control selectpicker" data-live-search='true' data-live-search="true">
131 131
                             <option data-school-id="0">All</option>
132 132
                             @foreach ($schools as $school)
133 133
                             <option data-school-id="{{ $school->id }}">
@@ -142,7 +142,7 @@
142 142
                     @if(Auth::user()->role==1 || Auth::user()->role==2 || Auth::user()->role==3)
143 143
                     <div class="form-group">
144 144
                         <label>Select the Program this rubric belongs to</label>
145
-                        <select id="select-program" class="form-control selectpicker">
145
+                        <select id="select-program" class="form-control selectpicker" data-live-search='true'>
146 146
                             @if(Auth::user()->role != 3)
147 147
                             <option data-program-id="0">All</option>
148 148
                             @endif
@@ -167,7 +167,7 @@
167 167
                     <div class="form-group">
168 168
                         <!-- Select percentage. If there is a rubric, select the saved value -->
169 169
 
170
-                        <select id="expected_percentage" class="form-control selectpicker">
170
+                        <select id="expected_percentage" class="form-control selectpicker" data-live-search='true'>
171 171
                             @for($i = 50; $i <= 100; $i++)
172 172
                                 @if($i==70)
173 173
                                     <option selected="selected" value="{{ $i }}">{{ $i }}</option>
@@ -182,7 +182,7 @@
182 182
 
183 183
                         
184 184
                         <!-- Select points. If there is a rubric, select the saved value -->
185
-                        <select id="expected_points" class="form-control selectpicker">
185
+                        <select id="expected_points" class="form-control selectpicker" data-live-search='true'>
186 186
                             @for($i = 0; $i <= 8; $i++)
187 187
                                 @if($i==5)
188 188
                                     <option selected="selected" value="{{ $i }}">{{ $i }}</option>
@@ -225,7 +225,7 @@
225 225
             <form>
226 226
                 <div class="form-group">
227 227
                     <label>Select a Learning Outcome</label>
228
-                    <select id="select-outcome" class="form-control selectpicker" >
228
+                    <select id="select-outcome" class="form-control selectpicker" data-live-search='true' >
229 229
                         @foreach ($outcomes as $outcome)
230 230
                         <option data-outcome-id="{{ $outcome->id }}">{{ $outcome->name }}</option>
231 231
                         @endforeach
@@ -233,14 +233,14 @@
233 233
                 </div>
234 234
                 <div class="form-group">
235 235
                     <label>Select an Objective</label>
236
-                    <select id="select-objective" class="form-control selectpicker" >
236
+                    <select id="select-objective" class="form-control selectpicker" data-live-search='true' >
237 237
                         
238 238
                     </select>
239 239
                 </div>
240 240
 
241 241
                     <div class="form-group">
242 242
                         <label>Select the Maximum Score</label>
243
-                    <select id="max_score" class="form-control selectpicker">
243
+                    <select id="max_score" class="form-control selectpicker" data-live-search='true'>
244 244
                         @for($i = 1; $i <= 100; $i++)
245 245
                             @if($i==8)
246 246
                                 <option selected="selected" value="{{ $i }}">{{ $i }}</option>
@@ -254,7 +254,7 @@
254 254
                 </div>
255 255
                 <div class="form-group">
256 256
                     <label>Select the Type of Rubric</label>
257
-                <select id="number_of_scales" class="form-control selectpicker" >
257
+                <select id="number_of_scales" class="form-control selectpicker" data-live-search='true' >
258 258
                     @for($i = 1; $i <= 20; $i++)
259 259
                     @if(8%$i == 0)
260 260
                     @if($i==1)
@@ -291,7 +291,7 @@
291 291
 
292 292
                 <div class="form-group">
293 293
                     <label>Select a Criterion</label><span id="updated-text" class="text-success small">  updated</span>
294
-                    <select id="select-criterion" class="form-control selectpicker">
294
+                    <select id="select-criterion" class="form-control selectpicker" data-live-search='true'>
295 295
                     </select>
296 296
                 </div>
297 297
 

+ 1
- 1
app/views/local/managers/shared/view-annual-plans.blade.php Переглянути файл

@@ -23,7 +23,7 @@
23 23
         <div class="col-md-3" id="here">
24 24
 
25 25
 
26
-            <select class="form-control selectpicker" id="annual_plan" onchange="createAllTables('annual_plan')">
26
+            <select class="form-control selectpicker" data-live-search='true' id="annual_plan" onchange="createAllTables('annual_plan')">
27 27
                 <option value='0'> Nothing Selected</option>
28 28
                 @foreach ($annual_plans as $an_plan)
29 29
                     <option value={{ $an_plan->id }}>Plan {{ $an_plan->academic_year }}</option>

+ 3
- 3
app/views/local/managers/shared/view_formative.blade.php Переглянути файл

@@ -43,7 +43,7 @@
43 43
         <div class="category">
44 44
             <label for="school">School</label>
45 45
             <div class="select">
46
-                <select class="selectpicker" name="school" id="school">
46
+                <select class="selectpicker" data-live-search='true' name="school" id="school">
47 47
 
48 48
                     @foreach ($schools as $school)
49 49
                         <option value="{{ $school->id }}">{{ $school->name }}</option>
@@ -54,7 +54,7 @@
54 54
         <div class="category">
55 55
             <label for="program">Academic Program</label>
56 56
             <div class="select">
57
-                <select class="selectpicker" name="program" id="program">
57
+                <select class="selectpicker" data-live-search='true' name="program" id="program">
58 58
 
59 59
                     @foreach ($programs as $program)
60 60
                         <option value="{{ $program->id }}">{{ $program->name }}</option>
@@ -65,7 +65,7 @@
65 65
         <div class="category">
66 66
             <label for="semesters">Semester</label>
67 67
             <div class="select">
68
-                <select class="selectpicker" name="semesters" id="semesters">
68
+                <select class="selectpicker" data-live-search='true' name="semesters" id="semesters">
69 69
 
70 70
                     @foreach ($semesters as $semester)
71 71
                         <option value="{{ $semester->id }}">{{ $semester->name }}</option>

+ 2
- 1
app/views/local/professors/activity.blade.php Переглянути файл

@@ -79,7 +79,7 @@
79 79
                         {{ Form::label('select-activity-criterion', 'Criteria') }}
80 80
 
81 81
                         <select id='select-activity-criterion' name="trans_act[]" data-count="1"
82
-                            class="form-control selectpicker">
82
+                            class="form-control selectpicker" data-live-search='true'>
83 83
                             @foreach ($activity_criterion as $ac)
84 84
                                 <option value='{{ $ac->id }}' selected>{{ $ac->name }}</option>
85 85
                             @endforeach
@@ -293,6 +293,7 @@
293 293
             });
294 294
             var select = $('<select/>', {
295 295
                 'class': 'selectpicker',
296
+                'data-live-search':'true',
296 297
                 'name': 'trans_act[]',
297 298
 
298 299
             })

+ 2
- 2
app/views/local/professors/course.blade.php Переглянути файл

@@ -151,7 +151,7 @@
151 151
           
152 152
                              <label>Activity 1</label>
153 153
                               
154
-                              <select id='select-activity-1' data-count = "1" class="form-control selectpicker" >
154
+                              <select id='select-activity-1' data-count = "1" class="form-control selectpicker" data-live-search='true' >
155 155
                                   @foreach ($activities as $activity)
156 156
                                  @if($activity->is_assessed())
157 157
                                   <option value='{{$activity->id}}' >{{$activity->name}}</option>
@@ -161,7 +161,7 @@
161 161
                               <hr>
162 162
                               <label>Activity 2</label>
163 163
 
164
-                              <select id='select-activity-2' data-count = "1" class="form-control selectpicker" >
164
+                              <select id='select-activity-2' data-count = "1" class="form-control selectpicker" data-live-search='true' >
165 165
                                 @foreach ($activities as $activity)
166 166
                                 @if($activity->is_assessed())
167 167
                                 <option value='{{$activity->id}}' >{{$activity->name}}</option>

+ 2
- 2
app/views/local/professors/rubrics.blade.php Переглянути файл

@@ -50,10 +50,10 @@
50 50
       <div class="form-group">
51 51
         @if($activity->draft)
52 52
         <label>Select a Rubric:</label>
53
-        <select id="select-template" class="form-control selectpicker">
53
+        <select id="select-template" class="form-control selectpicker" data-live-search='true'>
54 54
         @else
55 55
         <label>Rubric (Assessment was published):</label>
56
-        <select id="select-template" class="form-control selectpicker" disabled>
56
+        <select id="select-template" class="form-control selectpicker" data-live-search='true' disabled>
57 57
         @endif
58 58
           @foreach ($templates as $template)
59 59
             @if(count($activity->rubric)!=0 && $template->name == Rubric::find($activity->rubric[0]->id)->name)