Browse Source

objetivos

parent
commit
294945d1b1

+ 46
- 18
app/controllers/Objective2Controller.php View File

45
 			return true;
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
 		/** Validation rules */
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
 	private function cleanInput()
93
 	private function cleanInput()
73
 	{
94
 	{
74
 		$clean_input = array();
95
 		$clean_input = array();
78
 
99
 
79
 		$clean_input['outcome_id'] = Input::get('outcome');
100
 		$clean_input['outcome_id'] = Input::get('outcome');
80
 		$counter = Input::get('counter') + 0;
101
 		$counter = Input::get('counter') + 0;
81
-		Log::info($clean_input);
102
+		//		Log::info($clean_input);
82
 
103
 
83
 		foreach ($clean_input['outcome_id'] as $index => $outcome_id) {
104
 		foreach ($clean_input['outcome_id'] as $index => $outcome_id) {
84
 			$clean_input['outcome_id'][$index] = trim(preg_replace('/\t+/', '', $clean_input['outcome_id'][$index]));
105
 			$clean_input['outcome_id'][$index] = trim(preg_replace('/\t+/', '', $clean_input['outcome_id'][$index]));
85
 		}
106
 		}
86
 
107
 
87
 		$clean_input['program_id'] = Input::get('program_id');
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
 		return $clean_input;
111
 		return $clean_input;
91
 	}
112
 	}
145
 				'typ_semester_outcome.id as typ_semester_outcome_id'
166
 				'typ_semester_outcome.id as typ_semester_outcome_id'
146
 			)
167
 			)
147
 			->get();
168
 			->get();
169
+
170
+
148
 		$json['typ_semester_objectives'] = DB::table('typ_semester_objectives')
171
 		$json['typ_semester_objectives'] = DB::table('typ_semester_objectives')
149
 			->where('objective_id', Input::get('id'))
172
 			->where('objective_id', Input::get('id'))
150
 			->get();
173
 			->get();
194
 		$clean_input = $this->cleanInput();
217
 		$clean_input = $this->cleanInput();
195
 
218
 
196
 		/** Validation rules */
219
 		/** Validation rules */
197
-		$validator = $this->makeValidator($clean_input);
220
+		$validator = $this->makeValidator($clean_input, false);
198
 
221
 
199
 		/** If validation fails */
222
 		/** If validation fails */
200
 		if ($validator->fails()) {
223
 		if ($validator->fails()) {
256
 			if ($objective->save()) {
279
 			if ($objective->save()) {
257
 				$objectiveId = $objective->id;
280
 				$objectiveId = $objective->id;
258
 
281
 
282
+				Log::info($clean_input['outcome_id']);
283
+
259
 
284
 
260
 				foreach ($clean_input['program_id'] as $program_id) {
285
 				foreach ($clean_input['program_id'] as $program_id) {
261
 					DB::insert("insert into objective_program (objective_id, program_id) values({$objectiveId},{$program_id})");
286
 					DB::insert("insert into objective_program (objective_id, program_id) values({$objectiveId},{$program_id})");
441
 		//Log::info(print_r($clean_input, true));
466
 		//Log::info(print_r($clean_input, true));
442
 
467
 
443
 		/** Validation rules */
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
 		/** If validation fails */
474
 		/** If validation fails */
447
 		if ($validator->fails()) {
475
 		if ($validator->fails()) {

+ 13
- 12
app/controllers/ThreeYearPlanController.php View File

70
       ->select('program_id')
70
       ->select('program_id')
71
       ->get();
71
       ->get();
72
     $program_id = $program_id[0]->program_id;*/
72
     $program_id = $program_id[0]->program_id;*/
73
+
73
     $outcomes = DB::table('outcomes')->where('deactivation_date', '=', null)->orderBy('name', 'ASC')->get();
74
     $outcomes = DB::table('outcomes')->where('deactivation_date', '=', null)->orderBy('name', 'ASC')->get();
74
     // se annadio la nueva variable
75
     // se annadio la nueva variable
75
     return View::make('global.view-three-year-plan', compact('title', 'last_year', 'outcomes', 'typs', 'criteria', 'semesters', 'program_id'));
76
     return View::make('global.view-three-year-plan', compact('title', 'last_year', 'outcomes', 'typs', 'criteria', 'semesters', 'program_id'));
366
             ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
367
             ->join('objective_program', 'objective_program.objective_id', '=', 'objectives.id')
367
             ->where('objective_program.program_id', $program_id)
368
             ->where('objective_program.program_id', $program_id)
368
             ->where('objective_outcome.outcome_id', $outcome_id)
369
             ->where('objective_outcome.outcome_id', $outcome_id)
369
-            ->where('objective_outcome.objective_id', "<>",0)
370
+            ->where('objective_outcome.objective_id', "<>", 0)
370
             ->select('objectives.id', 'objectives.text', 'outcomes.name as outcome_name')
371
             ->select('objectives.id', 'objectives.text', 'outcomes.name as outcome_name')
371
             ->orderBy('objectives.text', 'asc')
372
             ->orderBy('objectives.text', 'asc')
372
             ->get();
373
             ->get();
446
 
447
 
447
           $semesters_->selected_objectives = array();
448
           $semesters_->selected_objectives = array();
448
           foreach ($result_objectives as $objectives_) {
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
             $result_courses = DB::table('courses')
457
             $result_courses = DB::table('courses')
457
               ->where('courses.program_id', $program_id)
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
               ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
464
               ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
464
               ->orderBy('courses.code', 'asc')
465
               ->orderBy('courses.code', 'asc')
648
 
649
 
649
     return View::make('global.print_three_year_plan', compact('typ_semesters', 'program', 'three_year_plan', 'typ_semesters', 'typ_semester_outcome'));
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 View File

103
             </div>
103
             </div>
104
             <br>
104
             <br>
105
             <!--<button type="button" class="btn btn-secondary" id = "three_year_button" data-toggle="modal" data-target="#three_year">Create Three Year Cycle</button>
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
         </div>
107
         </div>
108
 
108
 
109
         <!-- Modal -->
109
         <!-- Modal -->
404
                 $.post(
404
                 $.post(
405
                     "{{ URL::action('ThreeYearPlanController@createAnnualPlan', [$program_id]) }}", {
405
                     "{{ URL::action('ThreeYearPlanController@createAnnualPlan', [$program_id]) }}", {
406
                         typ_id: $('#table-cycles').data('typ-id')
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
             // When list item is clicked, load corresponding info
415
             // When list item is clicked, load corresponding info

+ 400
- 377
app/views/layouts/master.blade.php
File diff suppressed because it is too large
View File


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

3
         <!--<div class="navbar-header">
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
     </div>-->
5
     </div>-->
6
-        <ul class="nav navbar-nav navbar-right">
6
+        <ul class="nav navbar-nav navbar-right ml-auto">
7
             <li>{{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Overview') }}</li>
7
             <li>{{ HTML::linkAction('ProgramCoordinatorsController@overview', 'Overview') }}</li>
8
 
8
 
9
             <li class="dropdown">
9
             <li class="dropdown">
142
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
142
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
143
                         </li>
143
                         </li>
144
                     @endforeach
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
                 </ul>
151
                 </ul>
146
             </li>
152
             </li>
147
 
153
 

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

3
         <!--<div class="navbar-header">
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
     </div>-->
5
     </div>-->
6
-        <ul class="nav navbar-nav navbar-right">
6
+        <ul class="nav navbar-nav navbar-right ml-auto">
7
             <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
7
             <li>{{ HTML::linkAction('SchoolCoordinatorsController@overview', 'Overview') }}</li>
8
 
8
 
9
             <li class="dropdown">
9
             <li class="dropdown">
69
                     <h6 class="dropdown-header">View Annual Plan from:</h6>
69
                     <h6 class="dropdown-header">View Annual Plan from:</h6>
70
                     @foreach (Auth::user()->school->programs as $program)
70
                     @foreach (Auth::user()->school->programs as $program)
71
                         <li><a
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
                         </li>
73
                         </li>
74
                     @endforeach
74
                     @endforeach
75
                 </ul>
75
                 </ul>
130
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
130
                                 href="{{ URL::action('OutcomesController@annualReport', $program->id) }}">{{ $program->name }}</a>
131
                         </li>
131
                         </li>
132
                     @endforeach
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
                 </ul>
139
                 </ul>
134
             </li>
140
             </li>
135
 
141
 

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

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

+ 9
- 9
app/views/local/managers/shared/annual_report.blade.php View File

68
 
68
 
69
 
69
 
70
                     <!-- <div class="table-responsive">
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
                 </div>
80
                 </div>
81
             </div>
81
             </div>
1580
                         'role': 'group'
1580
                         'role': 'group'
1581
                     });
1581
                     });
1582
                     button_save = $('<button>', {
1582
                     button_save = $('<button>', {
1583
-                        'class': ' btn btn-lg btn-primary ',
1583
+                        'class': ' btn btn-lg btn-primary btn-block',
1584
                         'type': 'button',
1584
                         'type': 'button',
1585
                         'onclick': 'check_if_ready(' + annual_id + ')'
1585
                         'onclick': 'check_if_ready(' + annual_id + ')'
1586
                     }).html('Submit Annual Report');
1586
                     }).html('Submit Annual Report');
1587
                     button_print = $("<button>", {
1587
                     button_print = $("<button>", {
1588
-                        "class": 'btn btn-lg btn-primary ',
1588
+                        "class": 'btn btn-lg btn-primary btn-block',
1589
                         "type": "button",
1589
                         "type": "button",
1590
                         "onclick": "window.location.href = " +
1590
                         "onclick": "window.location.href = " +
1591
                             "'{{ URL::action('AnnualPlansController@printAnnualReport') }}" +
1591
                             "'{{ URL::action('AnnualPlansController@printAnnualReport') }}" +