Gabriel Santiago Plaza 2 gadus atpakaļ
vecāks
revīzija
294945d1b1

+ 46
- 18
app/controllers/Objective2Controller.php Parādīt failu

@@ -45,30 +45,51 @@ class Objective2Controller extends \BaseController
45 45
 			return true;
46 46
 	}
47 47
 
48
-
49
-	private function makeValidator($clean_input)
48
+	//edit == true or edit == false
49
+	private function makeValidator($clean_input, $edit)
50 50
 	{
51 51
 		/** Validation rules */
52
-		return Validator::make(
53
-			array(
54
-				'text' => $clean_input['text'],
55 52
 
56
-				'outcome_id' => $clean_input['outcome_id'],
57
-				'program_id' => $clean_input['program_id']
53
+		if (!$edit) {
54
+			return Validator::make(
55
+				array(
56
+					'text' => $clean_input['text'],
58 57
 
59
-			),
60
-			array(
61
-				'text' => 'required|string',
58
+					'outcome_id' => $clean_input['outcome_id'],
59
+					'program_id' => $clean_input['program_id']
62 60
 
63
-				'outcome_id' => 'required|array',
64
-				'program_id' => 'required|array'
61
+				),
62
+				array(
65 63
 
66
-			)
64
+					'outcome_id' => 'required|array',
65
+					'program_id' => 'required|array'
66
+
67
+				)
68
+
69
+			);
70
+		} else {
71
+			return Validator::make(
72
+				array(
73
+					'text' => $clean_input['text'],
74
+
75
+					'outcome_id' => $clean_input['outcome_id'],
76
+					'program_id' => $clean_input['program_id']
77
+
78
+				),
79
+				array(
80
+					'text' => 'required|string|unique',
67 81
 
68
-		);
82
+					'outcome_id' => 'required|array',
83
+					'program_id' => 'required|array'
84
+
85
+				)
86
+
87
+			);
88
+		}
69 89
 	}
70 90
 
71 91
 
92
+
72 93
 	private function cleanInput()
73 94
 	{
74 95
 		$clean_input = array();
@@ -78,14 +99,14 @@ class Objective2Controller extends \BaseController
78 99
 
79 100
 		$clean_input['outcome_id'] = Input::get('outcome');
80 101
 		$counter = Input::get('counter') + 0;
81
-		Log::info($clean_input);
102
+		//		Log::info($clean_input);
82 103
 
83 104
 		foreach ($clean_input['outcome_id'] as $index => $outcome_id) {
84 105
 			$clean_input['outcome_id'][$index] = trim(preg_replace('/\t+/', '', $clean_input['outcome_id'][$index]));
85 106
 		}
86 107
 
87 108
 		$clean_input['program_id'] = Input::get('program_id');
88
-		Log::info(Input::get('program_id'));
109
+		//		Log::info(Input::get('program_id'));
89 110
 
90 111
 		return $clean_input;
91 112
 	}
@@ -145,6 +166,8 @@ class Objective2Controller extends \BaseController
145 166
 				'typ_semester_outcome.id as typ_semester_outcome_id'
146 167
 			)
147 168
 			->get();
169
+
170
+
148 171
 		$json['typ_semester_objectives'] = DB::table('typ_semester_objectives')
149 172
 			->where('objective_id', Input::get('id'))
150 173
 			->get();
@@ -194,7 +217,7 @@ class Objective2Controller extends \BaseController
194 217
 		$clean_input = $this->cleanInput();
195 218
 
196 219
 		/** Validation rules */
197
-		$validator = $this->makeValidator($clean_input);
220
+		$validator = $this->makeValidator($clean_input, false);
198 221
 
199 222
 		/** If validation fails */
200 223
 		if ($validator->fails()) {
@@ -256,6 +279,8 @@ class Objective2Controller extends \BaseController
256 279
 			if ($objective->save()) {
257 280
 				$objectiveId = $objective->id;
258 281
 
282
+				Log::info($clean_input['outcome_id']);
283
+
259 284
 
260 285
 				foreach ($clean_input['program_id'] as $program_id) {
261 286
 					DB::insert("insert into objective_program (objective_id, program_id) values({$objectiveId},{$program_id})");
@@ -441,7 +466,10 @@ class Objective2Controller extends \BaseController
441 466
 		//Log::info(print_r($clean_input, true));
442 467
 
443 468
 		/** Validation rules */
444
-		$validator = $this->makeValidator($clean_input);
469
+		if ($clean_input['text'] == $Objective->text) {
470
+			$validator = $this->makeValidator($clean_input, true);
471
+		} else
472
+			$validator = $this->makeValidator($clean_input, false);
445 473
 
446 474
 		/** If validation fails */
447 475
 		if ($validator->fails()) {

+ 13
- 12
app/controllers/ThreeYearPlanController.php Parādīt failu

@@ -70,6 +70,7 @@ class ThreeYearPlanController extends \BaseController
70 70
       ->select('program_id')
71 71
       ->get();
72 72
     $program_id = $program_id[0]->program_id;*/
73
+
73 74
     $outcomes = DB::table('outcomes')->where('deactivation_date', '=', null)->orderBy('name', 'ASC')->get();
74 75
     // se annadio la nueva variable
75 76
     return View::make('global.view-three-year-plan', compact('title', 'last_year', 'outcomes', 'typs', 'criteria', 'semesters', 'program_id'));
@@ -366,7 +367,7 @@ class ThreeYearPlanController extends \BaseController
366 367
             ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
367 368
             ->where('objective_program.program_id', $program_id)
368 369
             ->where('objective_outcome.outcome_id', $outcome_id)
369
-            ->where('objective_outcome.objective_id', "<>",0)
370
+            ->where('objective_outcome.objective_id', "<>", 0)
370 371
             ->select('objectives.id', 'objectives.text', 'outcomes.name as outcome_name')
371 372
             ->orderBy('objectives.text', 'asc')
372 373
             ->get();
@@ -446,19 +447,19 @@ class ThreeYearPlanController extends \BaseController
446 447
 
447 448
           $semesters_->selected_objectives = array();
448 449
           foreach ($result_objectives as $objectives_) {
449
-//             $result_courses = DB::table('courses')
450
-//               ->where('courses.program_id', $program_id)
451
-//               ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
452
-//               ->orderBy('courses.number', 'asc')
453
-//               ->groupBy('courses.name', 'courses.code')
454
-//               ->get();
450
+            //             $result_courses = DB::table('courses')
451
+            //               ->where('courses.program_id', $program_id)
452
+            //               ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
453
+            //               ->orderBy('courses.number', 'asc')
454
+            //               ->groupBy('courses.name', 'courses.code')
455
+            //               ->get();
455 456
 
456 457
             $result_courses = DB::table('courses')
457 458
               ->where('courses.program_id', $program_id)
458
-              ->orWhereIn('courses.program_id', function ($q) use ($program_id){
459
-              		$q->select('other_program_id')
460
-              		  ->from('other_programs_courses_typ')
461
-              		  ->where('program_id',$program_id);	
459
+              ->orWhereIn('courses.program_id', function ($q) use ($program_id) {
460
+                $q->select('other_program_id')
461
+                  ->from('other_programs_courses_typ')
462
+                  ->where('program_id', $program_id);
462 463
               })
463 464
               ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
464 465
               ->orderBy('courses.code', 'asc')
@@ -648,4 +649,4 @@ class ThreeYearPlanController extends \BaseController
648 649
 
649 650
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));
650 651
   }
651
-}
652
+}

+ 6
- 4
app/views/global/view-three-year-plan.blade.php Parādīt failu

@@ -103,7 +103,7 @@
103 103
             </div>
104 104
             <br>
105 105
             <!--<button type="button" class="btn btn-secondary" id = "three_year_button" data-toggle="modal" data-target="#three_year">Create Three Year Cycle</button>
106
-                          -->
106
+                              -->
107 107
         </div>
108 108
 
109 109
         <!-- Modal -->
@@ -404,10 +404,12 @@
404 404
                 $.post(
405 405
                     "{{ URL::action('ThreeYearPlanController@createAnnualPlan', [$program_id]) }}", {
406 406
                         typ_id: $('#table-cycles').data('typ-id')
407
-                    });
408
-                window.location.href =
409
-                    "{{ URL::action('AnnualPlansController@showPlan', [$program_id]) }}";
407
+                    },
408
+                    function() {
409
+                        window.location.href =
410
+                            "{{ URL::action('AnnualPlansController@showPlan', [$program_id]) }}";
410 411
 
412
+                    });
411 413
             });
412 414
 
413 415
             // When list item is clicked, load corresponding info

+ 400
- 377
app/views/layouts/master.blade.php
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 7
- 1
app/views/local/managers/pCoords/_new_navigation.blade.php Parādīt failu

@@ -3,7 +3,7 @@
3 3
         <!--<div class="navbar-header">
4 4
       {{ HTML::linkAction('ProgramCoordinatorsController@overview','Online Learning Assessment System · Program Coordinator',[],['class' => 'navbar-brand']) }}
5 5
     </div>-->
6
-        <ul class="nav navbar-nav navbar-right">
6
+        <ul class="nav navbar-nav navbar-right ml-auto">
7 7
             <li>{{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Overview') }}</li>
8 8
 
9 9
             <li class="dropdown">
@@ -142,6 +142,12 @@
142 142
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
143 143
                         </li>
144 144
                     @endforeach
145
+                    <h6 class="dropdown-header">View Annual Report from:</h6>
146
+                    @foreach (Auth::user()->programs as $program)
147
+                        <li><a
148
+                                href="{{ URL::action('AnnualPlansController@annualPlansShow', ['report', $program->id]) }}">{{ $program->name }}</a>
149
+                        </li>
150
+                    @endforeach
145 151
                 </ul>
146 152
             </li>
147 153
 

+ 8
- 2
app/views/local/managers/sCoords/_new_navigation.blade.php Parādīt failu

@@ -3,7 +3,7 @@
3 3
         <!--<div class="navbar-header">
4 4
       {{ HTML::linkAction('ProgramCoordinatorsController@overview','Online Learning Assessment System · Program Coordinator',[],['class' => 'navbar-brand']) }}
5 5
     </div>-->
6
-        <ul class="nav navbar-nav navbar-right">
6
+        <ul class="nav navbar-nav navbar-right ml-auto">
7 7
             <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
8 8
 
9 9
             <li class="dropdown">
@@ -69,7 +69,7 @@
69 69
                     <h6 class="dropdown-header">View Annual Plan from:</h6>
70 70
                     @foreach (Auth::user()->school->programs as $program)
71 71
                         <li><a
72
-                                href="{{ URL::action('AnnualPlansController@viewAllPlans', [$program->id]) }}">{{ $program->name }}</a>
72
+                                href="{{ URL::action('AnnualPlansController@annualPlansShow', ['plan', $program->id]) }}">{{ $program->name }}</a>
73 73
                         </li>
74 74
                     @endforeach
75 75
                 </ul>
@@ -130,6 +130,12 @@
130 130
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
131 131
                         </li>
132 132
                     @endforeach
133
+                    <h6 class="dropdown-header">View Annual Report from:</h6>
134
+                    @foreach (Auth::user()->programs as $program)
135
+                        <li><a
136
+                                href="{{ URL::action('AnnualPlansController@annualPlansShow', ['report', $program->id]) }}">{{ $program->name }}</a>
137
+                        </li>
138
+                    @endforeach
133 139
                 </ul>
134 140
             </li>
135 141
 

+ 2
- 2
app/views/local/managers/shared/annual-plans.blade.php Parādīt failu

@@ -1353,12 +1353,12 @@
1353 1353
                         'role': 'group'
1354 1354
                     });
1355 1355
                     button_save = $('<button>', {
1356
-                        'class': 'btn btn-lg btn-primary',
1356
+                        'class': 'btn btn-lg btn-primary btn-block',
1357 1357
                         'type': 'button',
1358 1358
                         'onclick': 'check_if_ready(' + annual_id + ')'
1359 1359
                     }).html('Submit Annual Plan');
1360 1360
                     button_print = $("<button>", {
1361
-                        "class": 'btn btn-lg btn-primary',
1361
+                        "class": 'btn btn-lg btn-primary btn-block',
1362 1362
                         "type": "button",
1363 1363
                         "onclick": "window.location.href = " +
1364 1364
                             "'{{ URL::action('AnnualPlansController@printAnnualPlan') }}" +

+ 9
- 9
app/views/local/managers/shared/annual_report.blade.php Parādīt failu

@@ -68,14 +68,14 @@
68 68
 
69 69
 
70 70
                     <!-- <div class="table-responsive">
71
-                                                                                                                                                                                                                                                                                                                <table class="table table-striped table-condensed datatable" style="table-layout: fixed ; width : 100%">
72
-                                                                                                                                                                                                                                                                                                                  <thead><tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th></tr></thead>
73
-                                                                                                                                                                                                                                                                                                                  <tbody>
74
-                                                                                                                                                                                                                                                                                                                  </tbody>
71
+                                                                                                                                                                                                                                                                                                                    <table class="table table-striped table-condensed datatable" style="table-layout: fixed ; width : 100%">
72
+                                                                                                                                                                                                                                                                                                                      <thead><tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th></tr></thead>
73
+                                                                                                                                                                                                                                                                                                                      <tbody>
74
+                                                                                                                                                                                                                                                                                                                      </tbody>
75 75
 
76
-                                                                                                                                                                                                                                                                                                                </table>
77
-                                                                                                                                                                                                                                                                                                                
78
-                                                                                                                                                                                                                                                                                                            </div>-->
76
+                                                                                                                                                                                                                                                                                                                    </table>
77
+                                                                                                                                                                                                                                                                                                                    
78
+                                                                                                                                                                                                                                                                                                                </div>-->
79 79
 
80 80
                 </div>
81 81
             </div>
@@ -1580,12 +1580,12 @@
1580 1580
                         'role': 'group'
1581 1581
                     });
1582 1582
                     button_save = $('<button>', {
1583
-                        'class': ' btn btn-lg btn-primary ',
1583
+                        'class': ' btn btn-lg btn-primary btn-block',
1584 1584
                         'type': 'button',
1585 1585
                         'onclick': 'check_if_ready(' + annual_id + ')'
1586 1586
                     }).html('Submit Annual Report');
1587 1587
                     button_print = $("<button>", {
1588
-                        "class": 'btn btn-lg btn-primary ',
1588
+                        "class": 'btn btn-lg btn-primary btn-block',
1589 1589
                         "type": "button",
1590 1590
                         "onclick": "window.location.href = " +
1591 1591
                             "'{{ URL::action('AnnualPlansController@printAnnualReport') }}" +