Browse Source

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

parent
commit
f2765c6984

+ 1
- 0
app/controllers/AnnualPlansController.php View File

@@ -1100,6 +1100,7 @@ class AnnualPlansController extends \BaseController
1100 1100
   public function checkIfPlanReady()
1101 1101
   {
1102 1102
     $annual_plan = AnnualPlan::findOrFail(Input::get("annual_id"));
1103
+      Log::info('annual_plan'.$annual_plan->courses);
1103 1104
 
1104 1105
     /*
1105 1106
       error = [

+ 49
- 1
app/controllers/ThreeYearPlanController.php View File

@@ -691,6 +691,7 @@ class ThreeYearPlanController extends \BaseController
691 691
 
692 692
   public function printPlan($program_id, $typ)
693 693
   {
694
+	$view=0;
694 695
 
695 696
     $program = DB::table('programs')->where('id', $program_id)->first();
696 697
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
@@ -733,7 +734,54 @@ class ThreeYearPlanController extends \BaseController
733 734
     //Log::info($typ_semester_outcome);
734 735
 
735 736
 
736
-    return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));
737
+    return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
738
+  }
739
+  
740
+  public function viewPlan($program_id, $typ)
741
+  {
742
+	$view=1;
743
+    $program = DB::table('programs')->where('id', $program_id)->first();
744
+    $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
745
+
746
+    $typ_program_id = DB::table('typ_program')->where('three_year_plan_id', $three_year_plan->id)
747
+      ->where('program_id', $program->id)
748
+      ->first()->id;
749
+
750
+    $typ_semesters = DB::table('semesters')
751
+      ->join('typ_semesters', 'semesters.id', '=', 'typ_semesters.semester_id')
752
+      ->where('typ_id', $three_year_plan->id)
753
+      ->orderBy('semester_id')
754
+      ->get();
755
+
756
+
757
+    foreach ($typ_semesters as $semester) {
758
+      $typ_semester_outcome[$semester->semester_id] = DB::table('typ_semester_outcome')
759
+        ->join('outcomes', 'outcomes.id', '=', 'typ_semester_outcome.outcome_id')
760
+        ->where('typ_program_id', $typ_program_id)
761
+        ->where('semester_id', $semester->semester_id)
762
+        ->select('typ_semester_outcome.id as typ_id')
763
+        ->addSelect('outcomes.id as outcome_id', 'outcomes.name')
764
+        ->get();
765
+
766
+      foreach ($typ_semester_outcome[$semester->semester_id] as $outcome) {
767
+        $outcome->objectives = DB::table('typ_semester_objectives')
768
+          ->join('objectives', 'objectives.id', '=', 'typ_semester_objectives.objective_id')
769
+          ->where('typ_semester_outcome_id', $outcome->typ_id)
770
+          ->select('typ_semester_objectives.id as typ_obj_id')
771
+          ->addSelect('objectives.text', 'objectives.id as objective_id')
772
+          ->get();
773
+        foreach ($outcome->objectives as $objective) {
774
+          $objective->courses = DB::table('typ_semester_courses')
775
+            ->join('courses', 'courses.id', '=', 'typ_semester_courses.course_id')
776
+            ->where('typ_semester_objective_id', $objective->typ_obj_id)
777
+            ->get();
778
+        }
779
+      }
780
+    }
781
+    Log::info($typ_semester_outcome);
782
+
783
+
784
+    return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome', 'view'));
737 785
   }
738 786
 
739 787
   public function showPDFs($program_id)

+ 4
- 0
app/models/AnnualPlan.php View File

@@ -32,6 +32,8 @@ class AnnualPlan extends \Eloquent
32 32
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
33 33
 			})
34 34
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
35
+			->join('typ_program', 'typ_program.program_id','=','annual_plans.program_id')
36
+			->where('typ_program.id','=','typ_semester_outcome.typ_program_id')
35 37
 			->where('annual_plans.program_id', $this->program_id)
36 38
 			->where('annual_plans.id', $this->id)
37 39
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
@@ -46,6 +48,8 @@ class AnnualPlan extends \Eloquent
46 48
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
47 49
 			})
48 50
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
51
+			->join('typ_program', 'typ_program.program_id','=','annual_plans.program_id')
52
+			->where('typ_program.id','=','typ_semester_outcome.typ_program_id')
49 53
 			->where('annual_plans.program_id', $this->program_id)
50 54
 			->where('annual_plans.id', $this->id)
51 55
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')

+ 4
- 0
app/routes.php View File

@@ -250,6 +250,10 @@ Route::group(array('before' => 'auth|has_access'), function () {
250 250
         'as' => 'printThreeYear/{program_id}/{typ}',
251 251
         'uses' => 'ThreeYearPlanController@printPlan'
252 252
     ));
253
+    Route::get('viewThreeYear/{program_id}/{typ}', array(
254
+        'as' => 'viewThreeYear/{program_id}/{typ}',
255
+        'uses' => 'ThreeYearPlanController@viewPlan'
256
+    ));
253 257
     // Fetch all criteria associated to an outcome
254 258
     Route::post('fetchInfo', array(
255 259
         'as' => 'fetchInfo',

+ 12
- 5
app/views/global/print_three_year_plan.blade.php View File

@@ -93,10 +93,12 @@ echo
93 93
     @media print{@page {size: landscape}}
94 94
 </style>';
95 95
 
96
-echo '<style type="text/css" media="print">
97
-  @page { size: landscape; }
98
-</style>';
99
-
96
+if(!$view) 
97
+{
98
+	echo '<style type="text/css" media="print">
99
+	  @page { size: landscape; }
100
+	</style>';
101
+}
100 102
 ?>
101 103
 <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
102 104
 
@@ -136,7 +138,7 @@ echo '<style type="text/css" media="print">
136 138
             <ol>
137 139
             @foreach($objective->courses as $course)
138 140
             
139
-    <li>[{{$course->code}}] {{$course->name}}</li>
141
+    <li>[{{$course->code}}{{$course->number}}] {{$course->name}}</li>
140 142
             
141 143
             @endforeach
142 144
         </ol>
@@ -158,6 +160,8 @@ echo '<style type="text/css" media="print">
158 160
 
159 161
 echo '</body>';
160 162
 echo '</html>';
163
+if(!$view)
164
+{
161 165
 ?>
162 166
 
163 167
 <script type="text/javascript">
@@ -165,3 +169,6 @@ echo '</html>';
165 169
 window.print();
166 170
 
167 171
 </script>
172
+<?php
173
+}
174
+?>

+ 5
- 0
app/views/global/view-three-year-plan.blade.php View File

@@ -143,6 +143,7 @@
143 143
 
144 144
         <div class="col-md-9">
145 145
             <div class="btn-group pull-right">
146
+                <a href="" id="view_button" class="btn btn-default" target="_blank" rel="noopener noreferrer">View</a>
146 147
                 <a href="" id="print_button" class="btn btn-default" target="_blank" rel="noopener noreferrer">Print</a>
147 148
             </div>
148 149
             <div id="cycle-display" class="panel panel-default">
@@ -419,6 +420,10 @@
419 420
                 $('#three_year_button').hide();
420 421
                 var id = $(this).data('cycle-id');
421 422
                 $('#table-cycles').data('typ-id', id);
423
+                $('#view_button').show();
424
+                $('#view_button').attr("href",
425
+                    "{{ URL::action('ThreeYearPlanController@viewPlan', [$program_id]) }}" +
426
+                    '/' + $(this).data('cycle-id'));
422 427
                 $('#print_button').show();
423 428
                 $('#print_button').attr("href",
424 429
                     "{{ URL::action('ThreeYearPlanController@printPlan', [$program_id]) }}" +

+ 2
- 2
app/views/local/managers/pCoords/_new_navigation.blade.php View File

@@ -103,7 +103,7 @@
103 103
                     Results<span class="caret"></span></a>
104 104
                 <ul class="dropdown-menu dropdown-menu-left" role="menu">
105 105
 
106
-                    <h6 class='dropdown-header'>Program Results For:</h6>
106
+                    <h6 class='dropdown-header'>Program Results for:</h6>
107 107
                     @foreach (Auth::user()->programs as $program)
108 108
                         <li><a href="{{ URL::action('OutcomesController@programAssessmentReport', $program->id) }}">{{ $program->name }}
109 109
                             </a></li>
@@ -143,7 +143,7 @@
143 143
                     Report<span class="caret"></span></a>
144 144
                 <ul class="dropdown-menu dropdown-menu-left" role="menu">
145 145
 
146
-                    <h6 class='dropdown-header'>Create/Edit Annual Report For:</h6>
146
+                    <h6 class='dropdown-header'>Create/Edit Annual Report for:</h6>
147 147
                     @foreach (Auth::user()->programs as $program)
148 148
                         <li><a
149 149
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>

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

@@ -70,7 +70,7 @@
70 70
             </li>
71 71
             <li class='dropdown'>
72 72
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Three
73
-                    year Plans<span class="caret"></span></a>
73
+                    Year Plans<span class="caret"></span></a>
74 74
                 <ul class='dropdown-menu' role='menu'>
75 75
                     @foreach (Auth::user()->school->programs as $program)
76 76
                         <li><a

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

@@ -131,7 +131,7 @@
131 131
                     Report<span class="caret"></span></a>
132 132
                 <ul class="dropdown-menu dropdown-menu-left" role="menu">
133 133
 
134
-                    <h6 class='dropdown-header'>Create/Edit Annual Report For:</h6>
134
+                    <h6 class='dropdown-header'>Create/Edit Annual Report for:</h6>
135 135
                     @foreach (Auth::user()->school->programs as $program)
136 136
                         <li><a
137 137
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>

+ 2
- 2
app/views/local/managers/shared/objectives.blade.php View File

@@ -249,7 +249,7 @@
249 249
             <div class="modal-content">
250 250
                 <div class="modal-header">
251 251
                     <button type="button" class="close" data-dismiss="modal">&times;</button>
252
-                    <h5 class="modal-title">Would you like to pair these new Outcomes to all the Criteria associated to
252
+                    <h5 class="modal-title">Would you like to pair these new Learning Outcomes to all the Criteria associated to
253 253
                         this Objective?</h5>
254 254
 
255 255
                 </div>
@@ -479,7 +479,7 @@
479 479
                         }).html('<span aria-hidden="true">×</span>');
480 480
                         alert.append(button);
481 481
                         alert.append(
482
-                            '<strong>If you wish to edit the disabled Outcomes you need to detach the Objective from every Criteria paired to it and this Objectvie cannot be in any annual plan with that Outcome</strong>'
482
+                            '<strong>If you wish to edit the disabled Learning Outcomes you need to detach the Objective from every Criteria paired to it and this Objectvie cannot be in any annual plan with that Learning Outcome</strong>'
483 483
                         )
484 484
 
485 485
                         alert.appendTo($('#message_to_disconnect'))