Bladeren bron

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

En objetivos
Carlos J Corrada Bravo 2 jaren geleden
bovenliggende
commit
55e08d9beb

+ 6
- 4
app/controllers/Objective2Controller.php Bestand weergeven

@@ -53,7 +53,7 @@ class Objective2Controller extends \BaseController
53 53
 		if ($edit) {
54 54
 			return Validator::make(
55 55
 				array(
56
-					'text' => $clean_input['text'],
56
+					//'text' => $clean_input['text'],
57 57
 
58 58
 					'outcome_id' => $clean_input['outcome_id'],
59 59
 					'program_id' => $clean_input['program_id']
@@ -77,7 +77,7 @@ class Objective2Controller extends \BaseController
77 77
 
78 78
 				),
79 79
 				array(
80
-					'text' => 'required|string|unique',
80
+					'text' => 'required|string|unique:objectives,text',
81 81
 
82 82
 					'outcome_id' => 'required|array',
83 83
 					'program_id' => 'required|array'
@@ -215,7 +215,7 @@ class Objective2Controller extends \BaseController
215 215
 	{
216 216
 
217 217
 		$clean_input = $this->cleanInput();
218
-
218
+		Log::info($clean_input);
219 219
 		/** Validation rules */
220 220
 		$validator = $this->makeValidator($clean_input, false);
221 221
 
@@ -282,12 +282,14 @@ class Objective2Controller extends \BaseController
282 282
 				Log::info($clean_input['outcome_id']);
283 283
 
284 284
 
285
+
286
+
285 287
 				foreach ($clean_input['program_id'] as $program_id) {
286 288
 					DB::insert("insert into objective_program (objective_id, program_id) values({$objectiveId},{$program_id})");
287 289
 				}
288 290
 				foreach ($clean_input['outcome_id'] as $outcome_id) {
289 291
 					DB::insert("insert into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
290
-
292
+					//DB::raw("insert ignore into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
291 293
 					/*if (!($objectiveOutcome->save())) {
292 294
 						Session::flash('status', 'danger');
293 295
 						Session::flash('message', '<p>Error creating objective. Please try again later.</p>');

+ 189
- 10
app/controllers/ThreeYearPlanController.php Bestand weergeven

@@ -1,6 +1,7 @@
1 1
 <?php
2 2
 
3 3
 use Illuminate\Database\Eloquent\Collection;
4
+use Barryvdh\DomPDF\PDF as PDF;
4 5
 
5 6
 class ThreeYearPlanController extends \BaseController
6 7
 {
@@ -55,7 +56,7 @@ class ThreeYearPlanController extends \BaseController
55 56
     }
56 57
 
57 58
     $program = Program::find($program_id);
58
-        Log::info($program);
59
+    Log::info($program);
59 60
 
60 61
     // el ID de los semestres que el usuario tiene seleccionado.
61 62
     $semesters_ids = Session::get('semesters_ids');
@@ -72,13 +73,10 @@ class ThreeYearPlanController extends \BaseController
72 73
       ->select('program_id')
73 74
       ->get();
74 75
     $program_id = $program_id[0]->program_id;*/
75
-    if($program->is_graduate==0)
76
-    {
77
-	    $outcomes = DB::table('outcomes')->where('deactivation_date', '=', null)->orderBy('name', 'ASC')->get();
78
-    }
79
-    else
80
-    {
81
-	    $outcomes = DB::table('outcomes')->where('deactivation_date', '=', null)->where('level', '=', 3)->orderBy('name', 'ASC')->get();    
76
+    if ($program->is_graduate == 0) {
77
+      $outcomes = DB::table('outcomes')->where('deactivation_date', '=', null)->orderBy('name', 'ASC')->get();
78
+    } else {
79
+      $outcomes = DB::table('outcomes')->where('deactivation_date', '=', null)->where('level', '=', 3)->orderBy('name', 'ASC')->get();
82 80
     }
83 81
 
84 82
     // se annadio la nueva variable
@@ -610,6 +608,85 @@ class ThreeYearPlanController extends \BaseController
610 608
       $yearStart++;
611 609
       $yearStartPlusOne++;
612 610
     }
611
+    $this->createThreeYearPlanPdf($program_id, $input_id);
612
+  }
613
+
614
+  public function  createThreeYearPlanPdf($program_id, $typ)
615
+  {
616
+    $program = DB::table('programs')->where('id', $program_id)->first();
617
+    $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
618
+
619
+    $typ_program_id = DB::table('typ_program')->where('three_year_plan_id', $three_year_plan->id)
620
+      ->where('program_id', $program->id)
621
+      ->first()->id;
622
+
623
+    $typ_semesters = DB::table('semesters')
624
+      ->join('typ_semesters', 'semesters.id', '=', 'typ_semesters.semester_id')
625
+      ->where('typ_id', $three_year_plan->id)
626
+      ->orderBy('semester_id')
627
+      ->get();
628
+
629
+
630
+    foreach ($typ_semesters as $semester) {
631
+      $typ_semester_outcome[$semester->semester_id] = DB::table('typ_semester_outcome')
632
+        ->join('outcomes', 'outcomes.id', '=', 'typ_semester_outcome.outcome_id')
633
+        ->where('typ_program_id', $typ_program_id)
634
+        ->where('semester_id', $semester->semester_id)
635
+        ->select('typ_semester_outcome.id as typ_id')
636
+        ->addSelect('outcomes.id as outcome_id', 'outcomes.name')
637
+        ->get();
638
+
639
+      foreach ($typ_semester_outcome[$semester->semester_id] as $outcome) {
640
+        $outcome->objectives = DB::table('typ_semester_objectives')
641
+          ->join('objectives', 'objectives.id', '=', 'typ_semester_objectives.objective_id')
642
+          ->where('typ_semester_outcome_id', $outcome->typ_id)
643
+          ->select('typ_semester_objectives.id as typ_obj_id')
644
+          ->addSelect('objectives.text', 'objectives.id as objective_id')
645
+          ->get();
646
+        foreach ($outcome->objectives as $objective) {
647
+          $objective->courses = DB::table('typ_semester_courses')
648
+            ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
649
+            ->where('typ_semester_objective_id', $objective->typ_obj_id)
650
+            ->get();
651
+        }
652
+      }
653
+    }
654
+
655
+    $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/three_year_plan_pdfs');
656
+    $pdf = $pdf->loadView('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'))
657
+      ->setOrientation("landscape")
658
+
659
+      ->setPaper('legal', 'landscape');
660
+    $path = app_path() . '/storage/three_year_plan_pdfs/' . date('d-m-Y') . '-for-' . $program->id . '-by-' . Auth::user()->id . '.pdf';
661
+    $pdf->save($path);
662
+    $name = date('d-m-Y') . '-for-' . $program->id . '.pdf';
663
+    $pdf->download($name);
664
+
665
+    //is a path already there
666
+
667
+    $it_exists = DB::table("paths_for_three_year_plans")
668
+      ->where('path_to_pdf', $path)
669
+      ->first();
670
+
671
+    if (isset($it_exists)) {
672
+      return '200';
673
+    }
674
+    //$user_id = Auth::user()->id;
675
+    DB::table("paths_for_three_year_plans")
676
+      ->where('typ_program_id', $typ_program_id)
677
+      ->where('user_id', Auth::user()->id)
678
+
679
+      ->update(array(
680
+        'last' => 0
681
+      ));
682
+
683
+    DB::table('paths_for_three_year_plans')->insert(array(
684
+      "path_to_pdf" => $path,
685
+      'typ_program_id' => $typ_program_id,
686
+      'last' => 1,
687
+      'user_id' => Auth::user()->id,
688
+      'date_posted' => date('Y-m-d')
689
+    ));
613 690
   }
614 691
 
615 692
   public function printPlan($program_id, $typ)
@@ -654,7 +731,7 @@ class ThreeYearPlanController extends \BaseController
654 731
         }
655 732
       }
656 733
     }
657
-    Log::info($typ_semester_outcome);
734
+    //Log::info($typ_semester_outcome);
658 735
 
659 736
 
660 737
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
@@ -706,4 +783,106 @@ class ThreeYearPlanController extends \BaseController
706 783
 
707 784
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
708 785
   }
709
-}
786
+
787
+  public function showPDFs($program_id)
788
+  {
789
+
790
+    $role = Auth::user()->role;
791
+    switch ($role) {
792
+      case 1:
793
+      case 2:
794
+      case 3:
795
+        $last = [1, 0];
796
+        break;
797
+
798
+      case 4:
799
+        $last = [1];
800
+
801
+        break;
802
+      default:
803
+        App::abort('404');
804
+    }
805
+
806
+
807
+    $title = "Three Year Plans for " . Program::findOrFail($program_id)->name;
808
+    $paths_with_users = DB::table('paths_for_three_year_plans')
809
+      ->join('typ_program', 'typ_program.id', '=', 'paths_for_three_year_plans.typ_program_id')
810
+      ->join('three_year_plan', 'typ_program.three_year_plan_id', '=', 'three_year_plan.id')
811
+      ->join('users', 'users.id', '=', 'paths_for_three_year_plans.user_id')
812
+
813
+      ->whereIn('last', $last)
814
+      ->where('typ_program.program_id', $program_id)
815
+      ->orderBy('date_posted', 'desc')
816
+      ->select('paths_for_three_year_plans.path_to_pdf', 'users.*', 'date_posted', 'three_year_plan.*', 'paths_for_three_year_plans.last', 'paths_for_three_year_plans.id as path_id')
817
+      ->get();
818
+
819
+    return View::make('local.managers.shared.new_view_three_year_plans', compact('paths_with_users', 'title', 'last', 'program_id'));
820
+  }
821
+
822
+  public function downloadPDF($download, $path_id)
823
+  {
824
+    $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/three_year_plan_pdfs');
825
+
826
+    $queryToPath = DB::table('paths_for_three_year_plans')
827
+      ->join('typ_program', 'typ_program.id', '=', 'paths_for_three_year_plans.typ_program_id')
828
+      ->where('paths_for_three_year_plans.id', $path_id)
829
+      ->first();
830
+
831
+    //Log::info("ERES TU? creo que no");
832
+
833
+    // $annualPlan = AnnualPlan::findOrFail($queryToPath->annual_plan_id);
834
+
835
+
836
+    $program = Program::findOrFail($queryToPath->program_id);
837
+
838
+
839
+    $typ_program_id = $queryToPath->typ_program_id;
840
+
841
+    $three_year_plan = DB::table('three_year_plan')
842
+      ->where('id', $queryToPath->three_year_plan_id)
843
+      ->first();
844
+
845
+    $typ_semesters = DB::table('semesters')
846
+      ->join('typ_semesters', 'semesters.id', '=', 'typ_semesters.semester_id')
847
+      ->where('typ_id', $queryToPath->three_year_plan_id)
848
+      ->orderBy('semester_id')
849
+      ->get();
850
+
851
+
852
+    foreach ($typ_semesters as $semester) {
853
+      $typ_semester_outcome[$semester->semester_id] = DB::table('typ_semester_outcome')
854
+        ->join('outcomes', 'outcomes.id', '=', 'typ_semester_outcome.outcome_id')
855
+        ->where('typ_program_id', $typ_program_id)
856
+        ->where('semester_id', $semester->semester_id)
857
+        ->select('typ_semester_outcome.id as typ_id')
858
+        ->addSelect('outcomes.id as outcome_id', 'outcomes.name')
859
+        ->get();
860
+
861
+      foreach ($typ_semester_outcome[$semester->semester_id] as $outcome) {
862
+        $outcome->objectives = DB::table('typ_semester_objectives')
863
+          ->join('objectives', 'objectives.id', '=', 'typ_semester_objectives.objective_id')
864
+          ->where('typ_semester_outcome_id', $outcome->typ_id)
865
+          ->select('typ_semester_objectives.id as typ_obj_id')
866
+          ->addSelect('objectives.text', 'objectives.id as objective_id')
867
+          ->get();
868
+        foreach ($outcome->objectives as $objective) {
869
+          $objective->courses = DB::table('typ_semester_courses')
870
+            ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
871
+            ->where('typ_semester_objective_id', $objective->typ_obj_id)
872
+            ->get();
873
+        }
874
+      }
875
+    }
876
+    //Log::info("ERES TU?");
877
+
878
+    $pdf = $pdf->loadView('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'))
879
+      ->setOrientation("landscape")
880
+
881
+      ->setPaper('legal', 'landscape');
882
+    if ($download == "download")
883
+      return $pdf->download(basename($queryToPath->path_to_pdf));
884
+
885
+    else
886
+      return $pdf->stream(basename($queryToPath->path_to_pdf));
887
+  }
888
+}

+ 43
- 0
app/database/migrations/2022_05_05_132830_path_to_three_year_plan.php Bestand weergeven

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

+ 14
- 18
app/database/seeds/UserTableSSNDecrypter.php Bestand weergeven

@@ -1,6 +1,7 @@
1 1
 <?php
2 2
 
3
-class UserTableSSNDecrypter extends Seeder {
3
+class UserTableSSNDecrypter extends Seeder
4
+{
4 5
 
5 6
     public function run()
6 7
     {
@@ -15,39 +16,35 @@ class UserTableSSNDecrypter extends Seeder {
15 16
         // Initiates time
16 17
         $time_start = microtime(true);
17 18
 
18
-        try
19
-        {
19
+        try {
20 20
             // Get all users in the database
21 21
             $users = User::all();
22 22
 
23 23
             // Iterate over all users
24
-            foreach ($users as $user)
25
-            {
24
+            foreach ($users as $user) {
26 25
                 // Skip update if too short in length
27
-                if(strlen($user->ssn)<10)
26
+                if (strlen($user->ssn) < 10)
28 27
                     continue;
29 28
 
30 29
                 // Update table
31 30
                 DB::table('users')
32 31
                     ->where('id', $user->id)
33
-                    ->update(array(
34
-                        'ssn' => Crypt::decrypt($user->ssn),
35
-                        // 'program_id' => $program_id, //should change when I know how this info will be given
36
-                        // 'updated_at' => date("Y-m-d H:i:s", time()),
32
+                    ->update(
33
+                        array(
34
+                            'ssn' => Crypt::decrypt($user->ssn),
35
+                            // 'program_id' => $program_id, //should change when I know how this info will be given
36
+                            // 'updated_at' => date("Y-m-d H:i:s", time()),
37 37
                         )
38 38
                     );
39 39
 
40
-                if($debug){
41
-                    $this->command->info('Decrypted ssn for '.$user->email.': '.$user->surnames.', '.$user->first_name);
40
+                if ($debug) {
41
+                    $this->command->info('Decrypted ssn for ' . $user->email . ': ' . $user->surnames . ', ' . $user->first_name);
42 42
                 }
43
-
44 43
             }
45
-
46 44
         }
47 45
 
48 46
         // If an exception is raised, show the message and add to error
49
-        catch(Exception $e)
50
-        {
47
+        catch (Exception $e) {
51 48
             $this->command->info($e->getMessage());
52 49
         };
53 50
 
@@ -58,5 +55,4 @@ class UserTableSSNDecrypter extends Seeder {
58 55
         // Display separator
59 56
         $this->command->info('------------------------------------------------------------');
60 57
     }
61
-
62
-}
58
+}

+ 5
- 0
app/routes.php Bestand weergeven

@@ -215,6 +215,11 @@ Route::group(array('before' => 'auth|has_access'), function () {
215 215
         'uses' => 'AnnualPlansController@fetchAnnualReport'
216 216
     ));
217 217
 
218
+    //View Three year plan
219
+
220
+    Route::get('three-year-plan/show/{program_id}', "ThreeYearPlanController@showPDFs");
221
+    Route::get("downloadThreeYearPlanPDF/{download}/{path_id}", "ThreeYearPlanController@downloadPDF");
222
+
218 223
     //View annual plans and report
219 224
 
220 225
     Route::get('{annual_report_or_plan}/show/{program_id}', "AnnualPlansController@annualPlansShow");

BIN
app/storage/three_year_plan_pdfs/05-05-2022-for-15-by-5478.pdf Bestand weergeven


+ 23
- 16
app/views/local/managers/pCoords/_new_navigation.blade.php Bestand weergeven

@@ -1,7 +1,7 @@
1 1
 <div class="navbar navbar-inverse navbar-static-top">
2 2
     <div class="container-fluid">
3 3
         <!--<div class="navbar-header">
4
-      {{ HTML::linkAction('ProgramCoordinatorsController@overview','Online Learning Assessment System · Program Coordinator',[],['class' => 'navbar-brand']) }}
4
+      {{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Online Learning Assessment System · Program Coordinator', [], ['class' => 'navbar-brand']) }}
5 5
     </div>-->
6 6
         <ul class="nav navbar-nav navbar-right ml-auto">
7 7
             <li>{{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Overview') }}</li>
@@ -9,7 +9,7 @@
9 9
             <li class="dropdown">
10 10
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
11 11
                     aria-expanded="false">Objectives<span class="caret"></span></a>
12
-                <ul class="dropdown-menu" role="menu">
12
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
13 13
                     <li>{{ HTML::linkAction('Objective2Controller@edit', 'Create/Edit Objectives') }}</li>
14 14
                     <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'View Objectives and Criteria') }}
15 15
                     </li>
@@ -20,14 +20,21 @@
20 20
 
21 21
             <li class='dropdown'>
22 22
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Three
23
-                    Year Plans<span class="caret"></span></a>
24
-                <ul class='dropdown-menu' role='menu'>
25
-                    <h6 class="dropdown-header">Create/Edit Three Year Plan for: </h6>
23
+                    year Plans<span class="caret"></span></a>
24
+                <ul class='dropdown-menu dropdown-menu-left' role='menu'>
25
+                    <h6 class="dropdown-header">Create/Edit Three Year Plan For: </h6>
26 26
                     @foreach (Auth::user()->programs as $program)
27 27
                         <li><a
28 28
                                 href="{{ URL::action('ThreeYearPlanController@threeYearsReport', [$program->id]) }}">{{ $program->name }}</a>
29 29
                         </li>
30 30
                     @endforeach
31
+
32
+                    <h6 class="dropdown-header">View Three Year Plan from:</h6>
33
+                    @foreach (Auth::user()->programs as $program)
34
+                        <li><a
35
+                                href="{{ URL::action('ThreeYearPlanController@showPDFs', [$program->id]) }}">{{ $program->name }}</a>
36
+                        </li>
37
+                    @endforeach
31 38
                 </ul>
32 39
             </li>
33 40
             <!--Criteria-->
@@ -35,7 +42,7 @@
35 42
             <li class='dropdown'>
36 43
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false">
37 44
                     Criteria<span class="caret"></span></a>
38
-                <ul class='dropdown-menu' role='menu'>
45
+                <ul class='dropdown-menu dropdown-menu-left' role='menu'>
39 46
 
40 47
                     <li>{{ HTML::linkAction('CriteriaController@edit', 'Create/Edit Criteria') }}</li>
41 48
                     <li>{{ HTML::linkAction('CriteriaController@index', 'View Criteria') }}</li>
@@ -46,7 +53,7 @@
46 53
             <li class='dropdown'>
47 54
                 <a href="#" class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false">
48 55
                     Transformative Actions <span class="caret"></span></a>
49
-                <ul class='dropdown-menu' role='menu'>
56
+                <ul class='dropdown-menu dropdown-menu-left' role='menu'>
50 57
                     <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Create/Edit Tranformative Actions') }}
51 58
 
52 59
 
@@ -59,8 +66,8 @@
59 66
             <li class='dropdown'>
60 67
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Annual
61 68
                     Plans<span class="caret"></span></a>
62
-                <ul class='dropdown-menu' role='menu'>
63
-                    <h6 class="dropdown-header">Create/Edit Annual Plan for: </h6>
69
+                <ul class='dropdown-menu dropdown-menu-left' role='menu'>
70
+                    <h6 class="dropdown-header">Create/Edit Annual Plan For: </h6>
64 71
                     @foreach (Auth::user()->programs as $program)
65 72
                         <li><a
66 73
                                 href="{{ URL::action('AnnualPlansController@showPlan', [$program->id]) }}">{{ $program->name }}</a>
@@ -83,7 +90,7 @@
83 90
             <li class="dropdown">
84 91
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
85 92
                     aria-expanded="false">Rubrics<span class="caret"></span></a>
86
-                <ul class="dropdown-menu" role="menu">
93
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
87 94
                     <li>{{ HTML::linkAction('TemplatesController@newTemplate_new', 'Create/Edit Rubrics') }}</li>
88 95
                     <li>{{ HTML::linkAction('TemplatesController@index', 'View Rubric List') }}</li>
89 96
                 </ul>
@@ -94,7 +101,7 @@
94 101
             <li class="dropdown">
95 102
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Program
96 103
                     Results<span class="caret"></span></a>
97
-                <ul class="dropdown-menu" role="menu">
104
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
98 105
 
99 106
                     <h6 class='dropdown-header'>Program Results for:</h6>
100 107
                     @foreach (Auth::user()->programs as $program)
@@ -114,14 +121,14 @@
114 121
 
115 122
                     <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">My
116 123
                         Courses<span class="caret"></span></a>
117
-                    <ul class="dropdown-menu" role="menu">
124
+                    <ul class="dropdown-menu dropdown-menu-left" role="menu">
118 125
                         <li> {{ HTML::linkAction('ProfessorsController@overview', 'View My Courses', null) }}</li>
119 126
                         <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReport', 'View My Courses\' Results') }}
120 127
 
121 128
                         </li>
122 129
                         <h6 class="dropdown-header">Sections: </h6>
123 130
                         @foreach (Auth::user()->courses as $course)
124
-                            <li> {{ HTML::linkAction('CoursesController@show',$course->code . $course->number . '-' . $course->section . ' (' . $course->semester->code . ')',['id' => $course->id]) }}
131
+                            <li> {{ HTML::linkAction('CoursesController@show', $course->code . $course->number . '-' . $course->section . ' (' . $course->semester->code . ')', ['id' => $course->id]) }}
125 132
                             </li>
126 133
                         @endforeach
127 134
                     </ul>
@@ -134,7 +141,7 @@
134 141
             <li class="dropdown">
135 142
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Annual
136 143
                     Report<span class="caret"></span></a>
137
-                <ul class="dropdown-menu" role="menu">
144
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
138 145
 
139 146
                     <h6 class='dropdown-header'>Create/Edit Annual Report for:</h6>
140 147
                     @foreach (Auth::user()->programs as $program)
@@ -158,7 +165,7 @@
158 165
             <li class="dropdown">
159 166
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span
160 167
                         class="caret"></span></a>
161
-                <ul class="dropdown-menu" role="menu">
168
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
162 169
                     <li>{{ HTML::linkAction('FeedbackController@create', 'Feedback') }}</li>
163 170
                     <!-- <li><a href="{{ asset('files/OLAS-intro.pdf') }}">Introduction to OLAS</a></li> -->
164 171
                     <li><a href="{{ asset('files/intro-avaluo.pdf') }}">Introduction to Assessment</a></li>
@@ -171,7 +178,7 @@
171 178
             <li class="dropdown">
172 179
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
173 180
                     aria-expanded="false">Account<span class="caret"></span></a>
174
-                <ul class="dropdown-menu" role="menu">
181
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
175 182
                     <li>{{ HTML::linkAction('UsersController@edit', 'Profile') }}</li>
176 183
                     <li>{{ HTML::linkAction('AuthController@logout', 'Log out (' . Auth::user()->email . ')') }}</li>
177 184
                 </ul>

+ 22
- 15
app/views/local/managers/sCoords/_new_navigation.blade.php Bestand weergeven

@@ -1,7 +1,7 @@
1 1
 <div class="navbar navbar-inverse navbar-static-top">
2 2
     <div class="container-fluid">
3 3
         <!--<div class="navbar-header">
4
-      {{ HTML::linkAction('ProgramCoordinatorsController@overview','Online Learning Assessment System · Program Coordinator',[],['class' => 'navbar-brand']) }}
4
+      {{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Online Learning Assessment System · Program Coordinator', [], ['class' => 'navbar-brand']) }}
5 5
     </div>-->
6 6
         <ul class="nav navbar-nav navbar-right ml-auto">
7 7
             <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
@@ -9,7 +9,7 @@
9 9
             <li class="dropdown">
10 10
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
11 11
                     aria-expanded="false">Objectives<span class="caret"></span></a>
12
-                <ul class="dropdown-menu" role="menu">
12
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
13 13
                     <li>{{ HTML::linkAction('Objective2Controller@edit', 'Create/Edit Objectives') }}</li>
14 14
                     <li>{{ HTML::linkAction('CriteriaController@objectivesIndex', 'View Objectives and Criteria') }}
15 15
                     </li>
@@ -20,14 +20,21 @@
20 20
 
21 21
             <li class='dropdown'>
22 22
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Three
23
-                    Year Plans<span class="caret"></span></a>
24
-                <ul class='dropdown-menu' role='menu'>
25
-                    <h6 class="dropdown-header">Create/Edit Three Year Plan for: </h6>
23
+                    year Plans<span class="caret"></span></a>
24
+                <ul class='dropdown-menu dropdown-menu-left ' role='menu'>
25
+                    <h6 class="dropdown-header">Create/Edit Three Year Plan For: </h6>
26 26
                     @foreach (Auth::user()->school->programs as $program)
27 27
                         <li><a
28 28
                                 href="{{ URL::action('ThreeYearPlanController@threeYearsReport', [$program->id]) }}">{{ $program->name }}</a>
29 29
                         </li>
30 30
                     @endforeach
31
+
32
+                    <h6 class="dropdown-header">View Three Year Plan from:</h6>
33
+                    @foreach (Auth::user()->school->programs as $program)
34
+                        <li><a
35
+                                href="{{ URL::action('ThreeYearPlanController@showPDFs', [$program->id]) }}">{{ $program->name }}</a>
36
+                        </li>
37
+                    @endforeach
31 38
                 </ul>
32 39
             </li>
33 40
             <!--Criteria-->
@@ -35,7 +42,7 @@
35 42
             <li class='dropdown'>
36 43
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false">
37 44
                     Criteria<span class="caret"></span></a>
38
-                <ul class='dropdown-menu' role='menu'>
45
+                <ul class='dropdown-menu dropdown-menu-left' role='menu'>
39 46
 
40 47
                     <li>{{ HTML::linkAction('CriteriaController@edit', 'Create/Edit Criteria') }}</li>
41 48
                     <li>{{ HTML::linkAction('CriteriaController@index', 'View Criteria') }}</li>
@@ -46,7 +53,7 @@
46 53
             <li class='dropdown'>
47 54
                 <a href="#" class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false">
48 55
                     Transformative Actions <span class="caret"></span></a>
49
-                <ul class='dropdown-menu' role='menu'>
56
+                <ul class='dropdown-menu dropdown-menu-left' role='menu'>
50 57
                     <li>{{ HTML::linkAction('TransformativeActionsController@editTA', 'Create/Edit Tranformative Actions') }}
51 58
 
52 59
 
@@ -59,8 +66,8 @@
59 66
             <li class='dropdown'>
60 67
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Annual
61 68
                     Plans<span class="caret"></span></a>
62
-                <ul class='dropdown-menu' role='menu'>
63
-                    <h6 class="dropdown-header">Create/Edit Annual Plan for: </h6>
69
+                <ul class='dropdown-menu dropdown-menu-left' role='menu'>
70
+                    <h6 class="dropdown-header">Create/Edit Annual Plan For: </h6>
64 71
                     @foreach (Auth::user()->school->programs as $program)
65 72
                         <li><a
66 73
                                 href="{{ URL::action('AnnualPlansController@showPlan', [$program->id]) }}">{{ $program->name }}</a>
@@ -83,7 +90,7 @@
83 90
             <li class="dropdown">
84 91
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
85 92
                     aria-expanded="false">Rubrics<span class="caret"></span></a>
86
-                <ul class="dropdown-menu" role="menu">
93
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
87 94
                     <li>{{ HTML::linkAction('TemplatesController@newTemplate_new', 'Create/Edit Rubrics') }}</li>
88 95
                     <li>{{ HTML::linkAction('TemplatesController@index', 'View Rubric List') }}</li>
89 96
                 </ul>
@@ -102,14 +109,14 @@
102 109
 
103 110
                     <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">My
104 111
                         Courses<span class="caret"></span></a>
105
-                    <ul class="dropdown-menu" role="menu">
112
+                    <ul class="dropdown-menu dropdown-menu-left" role="menu">
106 113
                         <li> {{ HTML::linkAction('ProfessorsController@overview', 'View My Courses', null) }}</li>
107 114
                         <li>{{ HTML::linkAction('OutcomesController@professorAssessmentReport', 'View My Courses\' Results') }}
108 115
 
109 116
                         </li>
110 117
                         <h6 class="dropdown-header">Sections: </h6>
111 118
                         @foreach (Auth::user()->courses as $course)
112
-                            <li> {{ HTML::linkAction('CoursesController@show',$course->code . $course->number . '-' . $course->section . ' (' . $course->semester->code . ')',['id' => $course->id]) }}
119
+                            <li> {{ HTML::linkAction('CoursesController@show', $course->code . $course->number . '-' . $course->section . ' (' . $course->semester->code . ')', ['id' => $course->id]) }}
113 120
                             </li>
114 121
                         @endforeach
115 122
                     </ul>
@@ -122,7 +129,7 @@
122 129
             <li class="dropdown">
123 130
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Annual
124 131
                     Report<span class="caret"></span></a>
125
-                <ul class="dropdown-menu" role="menu">
132
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
126 133
 
127 134
                     <h6 class='dropdown-header'>Create/Edit Annual Report for:</h6>
128 135
                     @foreach (Auth::user()->school->programs as $program)
@@ -146,7 +153,7 @@
146 153
             <li class="dropdown">
147 154
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Help<span
148 155
                         class="caret"></span></a>
149
-                <ul class="dropdown-menu" role="menu">
156
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
150 157
                     <li>{{ HTML::linkAction('FeedbackController@create', 'Feedback') }}</li>
151 158
                     <!-- <li><a href="{{ asset('files/OLAS-intro.pdf') }}">Introduction to OLAS</a></li> -->
152 159
                     <li><a href="{{ asset('files/intro-avaluo.pdf') }}">Introduction to Assessment</a></li>
@@ -159,7 +166,7 @@
159 166
             <li class="dropdown">
160 167
                 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
161 168
                     aria-expanded="false">Account<span class="caret"></span></a>
162
-                <ul class="dropdown-menu" role="menu">
169
+                <ul class="dropdown-menu dropdown-menu-left" role="menu">
163 170
                     <li>{{ HTML::linkAction('UsersController@edit', 'Profile') }}</li>
164 171
                     <li>{{ HTML::linkAction('AuthController@logout', 'Log out (' . Auth::user()->email . ')') }}</li>
165 172
                 </ul>

+ 89
- 0
app/views/local/managers/shared/new_view_three_year_plans.blade.php Bestand weergeven

@@ -0,0 +1,89 @@
1
+@extends('layouts.master-2')
2
+
3
+@section('navigation')
4
+    @if (Auth::user()->role == 1)
5
+        @include('local.managers.admins._navigation')
6
+    @elseif(Auth::user()->role == 2)
7
+        @include('local.managers.sCoords._new_navigation')
8
+    @elseif(Auth::user()->role == 3)
9
+        @include('local.managers.pCoords._new_navigation')
10
+    @elseif(Auth::user()->role == 4)
11
+        @include('local.professors._navigation')
12
+    @endif
13
+@stop
14
+@section('main')
15
+
16
+    {{-- TODO: look where to place this script.
17
+          if placed inside .ready() or before it,
18
+            an error that the function is not defined occurs. --}}
19
+    {{-- TODO: no reconoce acentos --}}
20
+
21
+
22
+    <div class="row">
23
+
24
+
25
+
26
+        <div class="col-md-12">
27
+            <div class="table-responsive table-responsive-0">
28
+                <table class="table table-striped table-condensed datatable">
29
+                    <thead id="theHead">
30
+                        <tr>
31
+                            <th>Cycle</th>
32
+                            <th>PDF Name</th>
33
+                            <th>User who submitted</th>
34
+                            <th>Date Submitted </th>
35
+                            <th>New Version</th>
36
+                            <th>Download</th>
37
+
38
+                        </tr>
39
+                    </thead>
40
+                    <tbody>
41
+                        @foreach ($paths_with_users as $info)
42
+                            <tr>
43
+                                <td> {{ $info->year_start }} - {{ $info->year_end }}</td>
44
+                                <td> <a
45
+                                        href="{{ URL::action('ThreeYearPlanController@downloadPDF', ['print', $info->path_id]) }}">
46
+                                        {{ basename($info->path_to_pdf) }}
47
+                                        <span class="glyphicon glyphicon-eye-open"></span>
48
+
49
+                                </td>
50
+                                <td> {{ $info->surnames . ', ' . $info->first_name }}</td>
51
+                                <td>
52
+                                    {{ $info->date_posted }}
53
+                                </td>
54
+                                <td>
55
+                                    @if ($info->last == 1)
56
+                                        <span class="glyphicon glyphicon-ok"></span>
57
+                                    @endif
58
+                                </td>
59
+                                <td>
60
+                                    <a type="button" class="btn btn-primary"
61
+                                        href="{{ URL::action('ThreeYearPlanController@downloadPDF', ['download', $info->path_id]) }}">
62
+                                        Download
63
+                                        <span class="glyphicon glyphicon-download-alt"></span>
64
+                                    </a>
65
+                                </td>
66
+
67
+                            </tr>
68
+                        @endforeach
69
+                    </tbody>
70
+                </table>
71
+            </div>
72
+        </div>
73
+
74
+
75
+
76
+    </div>
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+@stop
86
+
87
+@section('included-js')
88
+    @include('global._datatables_js')
89
+@stop