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
   public function checkIfPlanReady()
1100
   public function checkIfPlanReady()
1101
   {
1101
   {
1102
     $annual_plan = AnnualPlan::findOrFail(Input::get("annual_id"));
1102
     $annual_plan = AnnualPlan::findOrFail(Input::get("annual_id"));
1103
+      Log::info('annual_plan'.$annual_plan->courses);
1103
 
1104
 
1104
     /*
1105
     /*
1105
       error = [
1106
       error = [

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

691
 
691
 
692
   public function printPlan($program_id, $typ)
692
   public function printPlan($program_id, $typ)
693
   {
693
   {
694
+	$view=0;
694
 
695
 
695
     $program = DB::table('programs')->where('id', $program_id)->first();
696
     $program = DB::table('programs')->where('id', $program_id)->first();
696
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
697
     $three_year_plan = DB::table('three_year_plan')->where('id', $typ)->first();
733
     //Log::info($typ_semester_outcome);
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
   public function showPDFs($program_id)
787
   public function showPDFs($program_id)

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

32
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
32
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
33
 			})
33
 			})
34
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
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
 			->where('annual_plans.program_id', $this->program_id)
37
 			->where('annual_plans.program_id', $this->program_id)
36
 			->where('annual_plans.id', $this->id)
38
 			->where('annual_plans.id', $this->id)
37
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
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
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
48
 					->orOn('typ_semester_outcome.semester_id', '=', 'annual_cycle.semester_end');
47
 			})
49
 			})
48
 			->join('annual_plans', 'annual_plans.annual_cycle_id', '=', 'annual_cycle.id')
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
 			->where('annual_plans.program_id', $this->program_id)
53
 			->where('annual_plans.program_id', $this->program_id)
50
 			->where('annual_plans.id', $this->id)
54
 			->where('annual_plans.id', $this->id)
51
 			->select('courses.*', 'typ_semester_courses.id as typ_semester_course_id', 'annual_plans.program_id', 'typ_semester_outcome.semester_id as semester_id')
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
         'as' => 'printThreeYear/{program_id}/{typ}',
250
         'as' => 'printThreeYear/{program_id}/{typ}',
251
         'uses' => 'ThreeYearPlanController@printPlan'
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
     // Fetch all criteria associated to an outcome
257
     // Fetch all criteria associated to an outcome
254
     Route::post('fetchInfo', array(
258
     Route::post('fetchInfo', array(
255
         'as' => 'fetchInfo',
259
         'as' => 'fetchInfo',

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

93
     @media print{@page {size: landscape}}
93
     @media print{@page {size: landscape}}
94
 </style>';
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
 <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
103
 <img class="logo" src="{{ asset('images/logo_uprrp_bw.png') }}" alt="UPRRP Logo">
102
 
104
 
136
             <ol>
138
             <ol>
137
             @foreach($objective->courses as $course)
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
             @endforeach
143
             @endforeach
142
         </ol>
144
         </ol>
158
 
160
 
159
 echo '</body>';
161
 echo '</body>';
160
 echo '</html>';
162
 echo '</html>';
163
+if(!$view)
164
+{
161
 ?>
165
 ?>
162
 
166
 
163
 <script type="text/javascript">
167
 <script type="text/javascript">
165
 window.print();
169
 window.print();
166
 
170
 
167
 </script>
171
 </script>
172
+<?php
173
+}
174
+?>

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

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

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

103
                     Results<span class="caret"></span></a>
103
                     Results<span class="caret"></span></a>
104
                 <ul class="dropdown-menu dropdown-menu-left" role="menu">
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
                     @foreach (Auth::user()->programs as $program)
107
                     @foreach (Auth::user()->programs as $program)
108
                         <li><a href="{{ URL::action('OutcomesController@programAssessmentReport', $program->id) }}">{{ $program->name }}
108
                         <li><a href="{{ URL::action('OutcomesController@programAssessmentReport', $program->id) }}">{{ $program->name }}
109
                             </a></li>
109
                             </a></li>
143
                     Report<span class="caret"></span></a>
143
                     Report<span class="caret"></span></a>
144
                 <ul class="dropdown-menu dropdown-menu-left" role="menu">
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
                     @foreach (Auth::user()->programs as $program)
147
                     @foreach (Auth::user()->programs as $program)
148
                         <li><a
148
                         <li><a
149
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
149
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>

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

70
             </li>
70
             </li>
71
             <li class='dropdown'>
71
             <li class='dropdown'>
72
                 <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded="false"> Three
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
                 <ul class='dropdown-menu' role='menu'>
74
                 <ul class='dropdown-menu' role='menu'>
75
                     @foreach (Auth::user()->school->programs as $program)
75
                     @foreach (Auth::user()->school->programs as $program)
76
                         <li><a
76
                         <li><a

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

131
                     Report<span class="caret"></span></a>
131
                     Report<span class="caret"></span></a>
132
                 <ul class="dropdown-menu dropdown-menu-left" role="menu">
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
                     @foreach (Auth::user()->school->programs as $program)
135
                     @foreach (Auth::user()->school->programs as $program)
136
                         <li><a
136
                         <li><a
137
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
137
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>

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

249
             <div class="modal-content">
249
             <div class="modal-content">
250
                 <div class="modal-header">
250
                 <div class="modal-header">
251
                     <button type="button" class="close" data-dismiss="modal">&times;</button>
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
                         this Objective?</h5>
253
                         this Objective?</h5>
254
 
254
 
255
                 </div>
255
                 </div>
479
                         }).html('<span aria-hidden="true">×</span>');
479
                         }).html('<span aria-hidden="true">×</span>');
480
                         alert.append(button);
480
                         alert.append(button);
481
                         alert.append(
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
                         alert.appendTo($('#message_to_disconnect'))
485
                         alert.appendTo($('#message_to_disconnect'))