Преглед изворни кода

Aqui va, objetivos y view annual plans

Gabriel Santiago Plaza пре 2 година
родитељ
комит
f4942bfd1c

+ 1
- 1
.gitignore Прегледај датотеку

12
 app/config/database.php
12
 app/config/database.php
13
 app/config/*
13
 app/config/*
14
 
14
 
15
-!app/config/app.php
15
+
16
 node_modules/
16
 node_modules/
17
 vendor/*
17
 vendor/*
18
 !vendor/barryvdh/
18
 !vendor/barryvdh/

+ 83
- 4
app/controllers/AnnualPlansController.php Прегледај датотеку

985
   {
985
   {
986
 
986
 
987
     $annualPlan = AnnualPlan::findOrFail($annual_id);
987
     $annualPlan = AnnualPlan::findOrFail($annual_id);
988
+    $user_id = Auth::user()->id;
988
     $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
989
     $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
989
-    $pdf = $pdf->loadView('local.managers.shared.print_annual_report', compact('annualPlan', 'download'))
990
+    $pdf = $pdf->loadView('local.managers.shared.print_annual_report', compact('annualPlan'))
990
       ->setOrientation("landscape")
991
       ->setOrientation("landscape")
991
 
992
 
992
       ->setPaper('legal', 'landscape');
993
       ->setPaper('legal', 'landscape');
993
-    $path = app_path() . '/storage/annual_pdfs/' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
994
+    $path = app_path() . '/storage/annual_pdfs/' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.pdf';
994
     $pdf->save($path);
995
     $pdf->save($path);
995
     $name = date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
996
     $name = date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
996
     $pdf->download($name);
997
     $pdf->download($name);
1004
     if (isset($it_exists)) {
1005
     if (isset($it_exists)) {
1005
       return '200';
1006
       return '200';
1006
     }
1007
     }
1007
-
1008
+    //$user_id = Auth::user()->id;
1008
     DB::table("paths_for_annual_plans")
1009
     DB::table("paths_for_annual_plans")
1009
       ->where('annual_plan_id', $annual_id)
1010
       ->where('annual_plan_id', $annual_id)
1011
+      ->where('user_id', $user_id)
1010
       ->where('report', 1)
1012
       ->where('report', 1)
1011
       ->update(array(
1013
       ->update(array(
1012
         'last' => 0
1014
         'last' => 0
1017
       'annual_plan_id' => $annual_id,
1019
       'annual_plan_id' => $annual_id,
1018
       'last' => 1,
1020
       'last' => 1,
1019
       'report' => 1,
1021
       'report' => 1,
1022
+      'user_id' => $user_id,
1023
+      'date_posted' => date('Y-m-d')
1020
     ));
1024
     ));
1021
 
1025
 
1022
 
1026
 
1027
+
1023
     return '200';
1028
     return '200';
1024
   }
1029
   }
1025
 
1030
 
1031
+  public function annualPlansShow($annual_report_or_plan, $program_id)
1032
+  {
1033
+    $role = Auth::user()->role;
1034
+    switch ($role) {
1035
+      case 1:
1036
+      case 2:
1037
+      case 3:
1038
+        $last = [1, 0];
1039
+        break;
1040
+
1041
+      case 4:
1042
+        $last = [1];
1043
+
1044
+        break;
1045
+      default:
1046
+        App::abort('404');
1047
+    }
1048
+
1049
+    if ($annual_report_or_plan == "report") {
1050
+      $report = 1;
1051
+    } else if ($annual_report_or_plan == "plan") {
1052
+      $report = 0;
1053
+    } else {
1054
+      App::abort('404');
1055
+    }
1056
+
1057
+    $title = "Annual Plans for " . Program::findOrFail($program_id)->name;
1058
+    $paths_with_users = DB::table('paths_for_annual_plans')
1059
+      ->join('annual_plans', 'annual_plans.id', '=', 'paths_for_annual_plans.annual_plan_id')
1060
+      ->join('annual_cycle', 'annual_cycle.id', '=', 'annual_plans.annual_cycle_id')
1061
+      ->join('users', 'users.id', '=', 'paths_for_annual_plans.user_id')
1062
+      ->where('report', $report)
1063
+      ->whereIn('last', $last)
1064
+      ->where('annual_plans.program_id', $program_id)
1065
+      ->orderBy('date_posted', 'desc')
1066
+      ->select('paths_for_annual_plans.path_to_pdf', 'users.*', 'date_posted', 'annual_cycle.*', 'paths_for_annual_plans.last', 'paths_for_annual_plans.id as path_id')
1067
+      ->get();
1068
+
1069
+    return View::make('local.managers.shared.new_view_annual_plans', compact('paths_with_users', 'title', 'report', 'last', 'annual_report_or_plan', 'program_id'));
1070
+  }
1071
+
1072
+  public function downloadPDF($download, $path_id)
1073
+  {
1074
+    $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
1075
+
1076
+    $queryToPath = DB::table('paths_for_annual_plans')
1077
+      ->where('id', $path_id)
1078
+      ->first();
1079
+
1080
+    Log::info("ERES TU? creo que no");
1081
+
1082
+    $annualPlan = AnnualPlan::findOrFail($queryToPath->annual_plan_id);
1083
+
1084
+    Log::info("ERES TU?");
1085
+
1086
+
1087
+    $pdf = $pdf->loadView('local.managers.shared.print_annual_report', compact('annualPlan'))
1088
+      ->setOrientation("landscape")
1089
+
1090
+      ->setPaper('legal', 'landscape');
1091
+    if ($download == "download")
1092
+      return $pdf->download(basename($queryToPath->path_to_pdf));
1093
+
1094
+    else
1095
+      return $pdf->stream(basename($queryToPath->path_to_pdf));
1096
+  }
1097
+
1098
+
1099
+
1026
   public function checkIfPlanReady()
1100
   public function checkIfPlanReady()
1027
   {
1101
   {
1028
     $annual_plan = AnnualPlan::findOrFail(Input::get("annual_id"));
1102
     $annual_plan = AnnualPlan::findOrFail(Input::get("annual_id"));
1142
     $alphabet = range("A", "Z");
1216
     $alphabet = range("A", "Z");
1143
     $small_alphabet = range('a', 'z');
1217
     $small_alphabet = range('a', 'z');
1144
     $annualPlan = AnnualPlan::findOrFail($annual_id);
1218
     $annualPlan = AnnualPlan::findOrFail($annual_id);
1219
+    $user_id = Auth::user()->id;
1145
     $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
1220
     $pdf = new PDF(app('config'), app("Filesystem"), app('view'), '/storage/plan_pdf');
1146
     $pdf = $pdf->loadView('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet'))
1221
     $pdf = $pdf->loadView('local.managers.shared.print_annual_plan', compact('annualPlan', 'alphabet', 'small_alphabet'))
1147
       ->setOrientation("landscape")
1222
       ->setOrientation("landscape")
1148
 
1223
 
1149
       ->setPaper('legal', 'landscape');
1224
       ->setPaper('legal', 'landscape');
1150
-    $path = app_path() . '/storage/annual_pdfs/plan-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
1225
+    $path = app_path() . '/storage/annual_pdfs/plan-on-' . date('d-m-Y') . '-for-' . $annualPlan->program->id . '-by-' . $user_id . '.pdf';
1151
     $pdf->save($path);
1226
     $pdf->save($path);
1152
     $name = "plan-on-" . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
1227
     $name = "plan-on-" . date('d-m-Y') . '-for-' . $annualPlan->program->id . '.pdf';
1153
     $pdf->download($name);
1228
     $pdf->download($name);
1165
     DB::table("paths_for_annual_plans")
1240
     DB::table("paths_for_annual_plans")
1166
       ->where('annual_plan_id', $annual_id)
1241
       ->where('annual_plan_id', $annual_id)
1167
       ->where('report', 0)
1242
       ->where('report', 0)
1243
+      ->where('user_id', $user_id)
1244
+
1168
       ->update(array(
1245
       ->update(array(
1169
         'last' => 0
1246
         'last' => 0
1170
       ));
1247
       ));
1174
       'annual_plan_id' => $annual_id,
1251
       'annual_plan_id' => $annual_id,
1175
       'last' => 1,
1252
       'last' => 1,
1176
       'report' => 0,
1253
       'report' => 0,
1254
+      'user_id' => $user_id,
1255
+      'date_posted' => date('Y-m-d')
1177
     ));
1256
     ));
1178
 
1257
 
1179
 
1258
 

+ 28
- 1
app/controllers/CriteriaController.php Прегледај датотеку

259
     }
259
     }
260
 
260
 
261
     public function delete()
261
     public function delete()
262
+
263
+
262
     {
264
     {
263
-        DB::delete("delete from criteria where id = ?", array(Input::get('criterion_delete')));
265
+
266
+        Log::info(Input::all());
267
+        Log::info("LLEGAMOS??");
268
+        $number_of_rows = DB::delete("delete from criteria where id = ?", array(Input::get('criterion_delete')));
269
+
270
+        if ($number_of_rows <= 0) {
271
+            $message = '<p>Error deleting Criterion:</p><ul>';
272
+
273
+
274
+
275
+            $message .= '</ul>';
276
+
277
+            /** Send error message and old data */
278
+            Session::flash('status', 'danger');
279
+            Session::flash('message', $message);
280
+        } else {
281
+            $message = '<p>Criterion deleted!</p><ul>';
282
+
283
+
284
+
285
+            $message .= '</ul>';
286
+
287
+            /** Send error message and old data */
288
+            Session::flash('status', 'success');
289
+            Session::flash('message', $message);
290
+        }
264
         return Redirect::to('criteria')->withInput();
291
         return Redirect::to('criteria')->withInput();
265
         $role = Auth::user()['role'];
292
         $role = Auth::user()['role'];
266
         switch ($role) {
293
         switch ($role) {

+ 65
- 4
app/controllers/Objective2Controller.php Прегледај датотеку

58
 
58
 
59
 			),
59
 			),
60
 			array(
60
 			array(
61
-				'text' => 'required|string|unique:objectives',
61
+				'text' => 'required|string',
62
 
62
 
63
 				'outcome_id' => 'required|array',
63
 				'outcome_id' => 'required|array',
64
 				'program_id' => 'required|array'
64
 				'program_id' => 'required|array'
102
 
102
 
103
 
103
 
104
 		$clean_input['program_id'] = Input::get('program_id');
104
 		$clean_input['program_id'] = Input::get('program_id');
105
+		$clean_input['pair_criteria'] =  Input::get('pair_every_criteria_with_objective');
105
 
106
 
106
 
107
 
107
 		return $clean_input;
108
 		return $clean_input;
116
 		$json = array();
117
 		$json = array();
117
 
118
 
118
 		$json['program'] = DB::select("select program_id from objective_program where objective_id = ?", array(Input::get('id')));
119
 		$json['program'] = DB::select("select program_id from objective_program where objective_id = ?", array(Input::get('id')));
119
-		$json['outcome'] = DB::select("select outcome_id from objective_outcome outc where outc.objective_id = ?", array(Input::get('id')));
120
+
121
+		//$json['outcome'] = DB::select("select outcome_id from objective_outcome outc where outc.objective_id = ?", array(Input::get('id')));
120
 		$json['objective'] = DB::select("select text, id from objectives where id =?", array(Input::get('id')));
122
 		$json['objective'] = DB::select("select text, id from objectives where id =?", array(Input::get('id')));
121
 		$json['assessment'] = DB::select("select * from assessments where activity_criterion_id  in (select id from activity_criterion where criterion_id in (select criterion_id from criterion_objective_outcome where objective_id = ?))", array(Input::get('id')));
123
 		$json['assessment'] = DB::select("select * from assessments where activity_criterion_id  in (select id from activity_criterion where criterion_id in (select criterion_id from criterion_objective_outcome where objective_id = ?))", array(Input::get('id')));
124
+		/*
125
+			select objective_outcome.*, typ_semester_outcome.id as typ_semester_outcome_id,count(criterion_id) from objectives join objective_outcome on objective_outcome.objective_id = objectives.id left join criterion_objective_outcome on criterion_objective_outcome.objective_id = objectives.id and objective_outcome.outcome_id = criterion_objective_outcome.outcome_id
126
+			 left join typ_semester_objectives on typ_semester_objectives.objective_id = objectives.id left join typ_semester_outcome on typ_semester_outcome.outcome_id = objective_outcome.outcome_id and typ_semester_outcome.id = typ_semester_objectives.typ_semester_outcome_id group by objectives.id, objective_outcome.outcome_id
127
+
128
+		*/
129
+		$json['outcome'] = DB::table('objective_outcome')
130
+
131
+			->leftJoin('criterion_objective_outcome', function ($j) {
132
+				$j->on('criterion_objective_outcome.objective_id', '=', 'objective_outcome.objective_id')
133
+					->on('criterion_objective_outcome.outcome_id', '=', 'objective_outcome.outcome_id');
134
+			})
135
+			->leftJoin('typ_semester_objectives', 'typ_semester_objectives.objective_id', '=', 'objective_outcome.objective_id')
136
+			->leftJoin('typ_semester_outcome', function ($j) {
137
+				$j->on('typ_semester_outcome.outcome_id', '=', 'objective_outcome.outcome_id')
138
+					->on('typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id');
139
+			})
140
+			->groupBy("objective_outcome.objective_id", 'objective_outcome.outcome_id')
141
+			->where('objective_outcome.objective_id', Input::get('id'))
142
+			->select(
143
+				'objective_outcome.*',
144
+				DB::raw("count(criterion_id) as count_criterion_id"),
145
+				'typ_semester_outcome.id as typ_semester_outcome_id'
146
+			)
147
+			->get();
148
+		$json['typ_semester_objectives'] = DB::table('typ_semester_objectives')
149
+			->where('objective_id', Input::get('id'))
150
+			->get();
122
 
151
 
123
 		$json['assoc_criteria'] = DB::select("select name from criteria where id in(select criterion_id from criterion_objective_outcome where objective_id =?)", array(Input::get('id')));
152
 		$json['assoc_criteria'] = DB::select("select name from criteria where id in(select criterion_id from criterion_objective_outcome where objective_id =?)", array(Input::get('id')));
124
 		Log::info('is here');
153
 		Log::info('is here');
464
 				//TODO
493
 				//TODO
465
 
494
 
466
 				$objectiveId = $Objective->id;
495
 				$objectiveId = $Objective->id;
467
-				DB::delete("delete from `objective_outcome` where objective_id ={$objectiveId}");
496
+				//DB::delete("delete from `objective_outcome` where objective_id ={$objectiveId}");
468
 				DB::delete("delete from objective_program where objective_id = {$objectiveId}");
497
 				DB::delete("delete from objective_program where objective_id = {$objectiveId}");
469
 
498
 
470
 				foreach ($clean_input['program_id'] as $program_id) {
499
 				foreach ($clean_input['program_id'] as $program_id) {
471
 					DB::insert("insert into `objective_program`(objective_id, program_id) values ({$objectiveId},{$program_id})");
500
 					DB::insert("insert into `objective_program`(objective_id, program_id) values ({$objectiveId},{$program_id})");
472
 				}
501
 				}
502
+				$criteria_assoc = DB::table('criterion_objective_outcome')
503
+					->join('program_criterion', 'program_criterion.criterion_id', '=', 'criterion_objective_outcome.criterion_id')
504
+					->whereIn('program_id', $clean_input['program_id'])
505
+					->where('objective_id', $objectiveId)
506
+					->groupBy('program_criterion.criterion_id')
507
+					->select('program_criterion.criterion_id')
508
+					->lists('program_criterion.criterion_id');
509
+
510
+				$criterion_array = [];
473
 				foreach ($clean_input['outcome_id'] as $outcome_id) {
511
 				foreach ($clean_input['outcome_id'] as $outcome_id) {
474
-					DB::insert("insert into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
512
+					$check_if_already_inserted = DB::table('objective_outcome')
513
+						->where('objective_id', $objectiveId)
514
+						->where('outcome_id', $outcome_id)
515
+						->first();
516
+
517
+					if (!isset($check_if_already_inserted)) {
518
+						DB::insert("insert into `objective_outcome` (objective_id, outcome_id) values ({$objectiveId}, {$outcome_id})");
519
+						if ($clean_input['pair_criteria'] == '1') {
520
+							foreach ($criteria_assoc as $criterion_id) {
521
+
522
+								DB::table('criterion_objective_outcome')
523
+									->insert(array(
524
+										"criterion_id" => $criterion_id,
525
+										"objective_id" => $objectiveId,
526
+										"outcome_id" => $outcome_id
527
+									));
528
+							}
529
+						}
530
+					}
475
 				}
531
 				}
476
 
532
 
533
+				DB::table('objective_outcome')
534
+					->whereNotIn('outcome_id', $clean_input['outcome_id'])
535
+					->where('objective_id', $objectiveId)
536
+					->delete();
537
+
477
 				//Session::flash('status', 'success');
538
 				//Session::flash('status', 'success');
478
 				//Session::flash('message', 'Updated Objective: "' . $Objective->text . '"');
539
 				//Session::flash('message', 'Updated Objective: "' . $Objective->text . '"');
479
 				$MessageArray = array('status' => 'success', 'message' => 'Updated Objective: "' . $Objective->text . '"');
540
 				$MessageArray = array('status' => 'success', 'message' => 'Updated Objective: "' . $Objective->text . '"');

+ 1
- 1
app/controllers/TransformativeActionsController.php Прегледај датотеку

1029
       } else {
1029
       } else {
1030
         $outcome_id = array($outcome_id);
1030
         $outcome_id = array($outcome_id);
1031
       }
1031
       }
1032
-
1032
+      Log::info($course_id);
1033
       // search TA with filters
1033
       // search TA with filters
1034
       $filtered_at = DB::table('transformative_actions')
1034
       $filtered_at = DB::table('transformative_actions')
1035
         ->join('ta_course', 'ta_course.ta_id', '=', 'transformative_actions.id')
1035
         ->join('ta_course', 'ta_course.ta_id', '=', 'transformative_actions.id')

+ 38
- 0
app/database/migrations/2022_04_26_151616_add_date_to_paths_for_annual_plans.php Прегледај датотеку

1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+use Illuminate\Support\Facades\Schema;
6
+
7
+class AddDateToPathsForAnnualPlans extends Migration
8
+{
9
+
10
+	/**
11
+	 * Run the migrations.
12
+	 *
13
+	 * @return void
14
+	 */
15
+	public function up()
16
+	{
17
+		Schema::table('paths_for_annual_plans', function (Blueprint $t) {
18
+			$t->date("date_posted");
19
+			$t->integer('user_id')->unsigned();
20
+			$t->foreign('user_id')
21
+				->references('id')
22
+				->on('users');
23
+		});
24
+	}
25
+
26
+	/**
27
+	 * Reverse the migrations.
28
+	 *
29
+	 * @return void
30
+	 */
31
+	public function down()
32
+	{
33
+		Schema::table('paths_for_annual_plans', function (Blueprint $t) {
34
+			$t->dropColumn("date_posted");
35
+			$t->dropColumn("user_id");
36
+		});
37
+	}
38
+}

+ 10
- 6
app/routes.php Прегледај датотеку

181
         )
181
         )
182
     );
182
     );
183
 
183
 
184
+
184
     Route::post('postAnnualReport/{annual_id?}', 'AnnualPlansController@postAnnualReport');
185
     Route::post('postAnnualReport/{annual_id?}', 'AnnualPlansController@postAnnualReport');
185
     Route::get('printAnnualPlan/{annual_plan?}', 'AnnualPlansController@printAnnualPlan');
186
     Route::get('printAnnualPlan/{annual_plan?}', 'AnnualPlansController@printAnnualPlan');
186
     Route::post('checkIfPlanReady', 'AnnualPlansController@checkIfPlanReady');
187
     Route::post('checkIfPlanReady', 'AnnualPlansController@checkIfPlanReady');
214
         'uses' => 'AnnualPlansController@fetchAnnualReport'
215
         'uses' => 'AnnualPlansController@fetchAnnualReport'
215
     ));
216
     ));
216
 
217
 
218
+    //View annual plans and report
219
+
220
+    Route::get('{annual_report_or_plan}/show/{program_id}', "AnnualPlansController@annualPlansShow");
221
+    Route::get("downloadAnnualPDF/{download}/{path_id}", "AnnualPlansController@downloadPDF");
222
+
217
     //Route::post('submitAnnualPlan', array('uses' => 'AnnualPlansController@submitAnnualPlan'));
223
     //Route::post('submitAnnualPlan', array('uses' => 'AnnualPlansController@submitAnnualPlan'));
218
 
224
 
219
     Route::post('fetchTransformativeStatus', array('uses' => 'TransformativeActionsController@fetchStatus'));
225
     Route::post('fetchTransformativeStatus', array('uses' => 'TransformativeActionsController@fetchStatus'));
222
 
228
 
223
     Route::post('futureTransformativeCourse', 'AnnualPlansController@futureTransformative');
229
     Route::post('futureTransformativeCourse', 'AnnualPlansController@futureTransformative');
224
     //other stuff
230
     //other stuff
231
+    Route::post('deleteCriterion', 'CriteriaController@delete');
225
     Route::post('postActivityCriterionTrans/{activity_id}', array(
232
     Route::post('postActivityCriterionTrans/{activity_id}', array(
226
         'as' => 'postActivityCriterionTrans/{activity_id}',
233
         'as' => 'postActivityCriterionTrans/{activity_id}',
227
         'uses' => 'TransformativeActionsController@postActivityCriterion'
234
         'uses' => 'TransformativeActionsController@postActivityCriterion'
270
         'as' => 'fetchAllCriterion',
277
         'as' => 'fetchAllCriterion',
271
         'uses' => 'CriteriaController@fetchAllCriterion'
278
         'uses' => 'CriteriaController@fetchAllCriterion'
272
     ));
279
     ));
273
-    Route::post('deleteCriterion', array(
274
-        'as' => 'deleteCriterion',
275
-        'uses' => 'CriteriaController@delete'
276
-    ));
280
+
277
 
281
 
278
     Route::get('viewFormative', array(
282
     Route::get('viewFormative', array(
279
         'as' => 'viewFormative',
283
         'as' => 'viewFormative',
376
 
380
 
377
         Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@updateMore'));
381
         Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@updateMore'));
378
         Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@update'));
382
         Route::post('learning-outcomes/update', array('before' => 'csrf', 'uses' => 'OutcomesController@update'));
379
-        Route::post('crtiteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
380
-        Route::delete('crtiteria/delete', array('before' => 'csrf', 'uses' => 'CriteriaController@destroy'));
383
+        Route::post('criteria/update', array('before' => 'csrf', 'uses' => 'CriteriaController@update'));
384
+        Route::delete('critteria/delete', array('before' => 'csrf', 'uses' => 'CriteriaController@destroy'));
381
 
385
 
382
         Route::get('administrator/users/{query?}', 'UsersController@index');
386
         Route::get('administrator/users/{query?}', 'UsersController@index');
383
 
387
 

BIN
app/storage/annual_pdfs/26-04-2022-for-15-by-3402.pdf Прегледај датотеку


BIN
app/storage/annual_pdfs/26-04-2022-for-15.pdf Прегледај датотеку


BIN
app/storage/annual_pdfs/plan-on-26-04-2022-for-15-by-3402.pdf Прегледај датотеку


+ 904
- 861
app/views/global/view-three-year-plan.blade.php
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 26
- 25
app/views/local/managers/admins/assessment_report.blade.php Прегледај датотеку

22
             <!-- <h3>Table of Contents</h3> -->
22
             <!-- <h3>Table of Contents</h3> -->
23
             <!-- <ol id="table-of-contents" class="upper-roman">
23
             <!-- <ol id="table-of-contents" class="upper-roman">
24
 
24
 
25
-                </ol> -->
25
+                    </ol> -->
26
 
26
 
27
 
27
 
28
             <h3 id="{{ $outcome->id }}" class="outcome">{{ $outcome->name }}</h3>
28
             <h3 id="{{ $outcome->id }}" class="outcome">{{ $outcome->name }}</h3>
31
                     <tr class="center-text">
31
                     <tr class="center-text">
32
                         <th>School or College</th>
32
                         <th>School or College</th>
33
                         <th>Academic Program</th>
33
                         <th>Academic Program</th>
34
-                        <th>Assesses Outcome</th>
34
+                        <th>Assesses Learning Outcome</th>
35
                         <th>Findings</th>
35
                         <th>Findings</th>
36
                     </tr>
36
                     </tr>
37
                 </thead>
37
                 </thead>
66
                                             <?php
66
                                             <?php
67
                                             
67
                                             
68
                                             /* $sections_evaluating_outcome = Course::has('activities')
68
                                             /* $sections_evaluating_outcome = Course::has('activities')
69
-                                            //                                             ->whereNotNull('outcomes_attempted')
70
-                                            //                                             ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
71
-                                                                                        ->with(array('activities'=>function($query) use(&$outcome){
72
-                                            //                                                 $query->whereNotNull('outcomes_attempted');
73
-                                            //                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
74
-                                            //                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
75
-                                                                                            } ))
76
-                                                                                        ->where('code', $course->code)->where('number',$course->number)
77
-                                                                                        ->whereIn('semester_id', Session::get('semesters_ids'))
78
-                                                                                        ->get();*/
69
+                                                                                        //                                             ->whereNotNull('outcomes_attempted')
70
+                                                                                        //                                             ->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'')
71
+                                                                                                                                    ->with(array('activities'=>function($query) use(&$outcome){
72
+                                                                                        //                                                 $query->whereNotNull('outcomes_attempted');
73
+                                                                                        //                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');} ))
74
+                                                                                        //                                                 $query->whereRaw('outcomes_attempted not like \'%"'.$outcome->id.'":0%\'');
75
+                                                                                                                                        } ))
76
+                                                                                                                                    ->where('code', $course->code)->where('number',$course->number)
77
+                                                                                                                                    ->whereIn('semester_id', Session::get('semesters_ids'))
78
+                                                                                                                                    ->get();*/
79
                                             
79
                                             
80
                                             $sections_evaluating_outcome = Course::has('activities')
80
                                             $sections_evaluating_outcome = Course::has('activities')
81
                                             
81
                                             
120
                                                             <h5>Measure {{ $activity_index + 1 }}</h5>
120
                                                             <h5>Measure {{ $activity_index + 1 }}</h5>
121
                                                             <?php
121
                                                             <?php
122
                                                             /*
122
                                                             /*
123
-                                                                                                                    var_dump($section->code);
124
-                                                                                                                    var_dump($section->number);
125
-                                                                                                                    var_dump($section->name);
126
-                                                                                                                    var_dump($outcome->name);
127
-                                                                                                                    var_dump(date('M Y', strtotime($activity->date)));
128
-                                                                                                                    var_dump($activity->name);
129
-                                                                                                                    var_dump(count($section->students));
130
-                                                                                                                    print"<br>";
131
-                                                                                                                    print "A rubric was used in the $section->code-$section->number ($section->name) course (". date('M Y', strtotime($activity->date)).") to assess students’ <u>". strtolower($outcome->name) ."</u> in the activity: '<strong>$activity->name </strong>'. N= ". count($section->students);
132
-                                                                                                                    exit();
133
-                                                                                                                    */
123
+                                                                                                                                                                                var_dump($section->code);
124
+                                                                                                                                                                                var_dump($section->number);
125
+                                                                                                                                                                                var_dump($section->name);
126
+                                                                                                                                                                                var_dump($outcome->name);
127
+                                                                                                                                                                                var_dump(date('M Y', strtotime($activity->date)));
128
+                                                                                                                                                                                var_dump($activity->name);
129
+                                                                                                                                                                                var_dump(count($section->students));
130
+                                                                                                                                                                                print"<br>";
131
+                                                                                                                                                                                print "A rubric was used in the $section->code-$section->number ($section->name) course (". date('M Y', strtotime($activity->date)).") to assess students’ <u>". strtolower($outcome->name) ."</u> in the activity: '<strong>$activity->name </strong>'. N= ". count($section->students);
132
+                                                                                                                                                                                exit();
133
+                                                                                                                                                                                */
134
                                                             ?>
134
                                                             ?>
135
 
135
 
136
 
136
 
137
                                                             <p>A rubric was used in the
137
                                                             <p>A rubric was used in the
138
                                                                 {{ $section->code }}-{{ $section->number }}
138
                                                                 {{ $section->code }}-{{ $section->number }}
139
-                                                                ({{ $section->name }}) course
139
+                                                                ({{ $section->name }})
140
+                                                                course
140
                                                                 ({{ date('M Y', strtotime($activity->date)) }}) to assess
141
                                                                 ({{ date('M Y', strtotime($activity->date)) }}) to assess
141
                                                                 students’ <u>{{ strtolower($outcome->name) }}</u> in the
142
                                                                 students’ <u>{{ strtolower($outcome->name) }}</u> in the
142
                                                                 activity: "<strong>{{ $activity->name }}</strong>". N=
143
                                                                 activity: "<strong>{{ $activity->name }}</strong>". N=
225
                                                             <br><br>
226
                                                             <br><br>
226
                                                         @else
227
                                                         @else
227
                                                             <h5>Measure {{ $activity_index + 1 }}</h5>
228
                                                             <h5>Measure {{ $activity_index + 1 }}</h5>
228
-                                                            <em>Outcome not measured.</em>
229
+                                                            <em>Learning Outcome not measured.</em>
229
                                                         @endif
230
                                                         @endif
230
                                                     @endforeach
231
                                                     @endforeach
231
                                                 @endforeach
232
                                                 @endforeach

+ 988
- 992
app/views/local/managers/admins/criteria.blade.php
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 12
- 16
app/views/local/managers/admins/objectives.blade.php Прегледај датотеку

19
                 <div class="panel-body">
19
                 <div class="panel-body">
20
                     {{ Form::open(['action' => 'Objective2Controller@create']) }}
20
                     {{ Form::open(['action' => 'Objective2Controller@create']) }}
21
                     <div id='outcomeGroup'>
21
                     <div id='outcomeGroup'>
22
-                        <label> Associated Outcome</label>
22
+                        <label> Associated Learning Outcome</label>
23
                         <div class="form-group col-md-11" id='outcomeForm'>
23
                         <div class="form-group col-md-11" id='outcomeForm'>
24
 
24
 
25
 
25
 
41
                         <span class='glyphicon glyphicon-plus'>
41
                         <span class='glyphicon glyphicon-plus'>
42
 
42
 
43
                         </span>
43
                         </span>
44
-                        Add another Outcome
44
+                        Add another Learning Outcome
45
                     </button>
45
                     </button>
46
 
46
 
47
                     <!-- Associated Program -->
47
                     <!-- Associated Program -->
53
                         <br>
53
                         <br>
54
 
54
 
55
                         @foreach ($programs as $program)
55
                         @foreach ($programs as $program)
56
-
57
                             <input type="checkbox" id="{{ $program->name }}" name="program_id[]"
56
                             <input type="checkbox" id="{{ $program->name }}" name="program_id[]"
58
                                 value="{{ $program->id }}">
57
                                 value="{{ $program->id }}">
59
                             <label for="{{ $program->name }}"> {{ $program->name }}
58
                             <label for="{{ $program->name }}"> {{ $program->name }}
99
                             </select>
98
                             </select>
100
                         </div>
99
                         </div>
101
                         <div class="form-group">
100
                         <div class="form-group">
102
-                            <label>Associated Outcome</label>
101
+                            <label>Associated Learning Outcome</label>
103
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
102
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
104
                             <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
103
                             <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
105
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
104
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
120
                         <select id="select-objective" name="id" class="form-control selectpicker">
119
                         <select id="select-objective" name="id" class="form-control selectpicker">
121
                             @foreach ($objectives as $objective)
120
                             @foreach ($objectives as $objective)
122
                                 <option value="{{ $objective->id }}" data-subtext="
121
                                 <option value="{{ $objective->id }}" data-subtext="
123
-                                             @if ($objective->program)
124
-                                    &nbsp;&nbsp;&nbsp;[{{ $objective->program->name }}]
125
-                            @endif
126
-                            ">
127
-                            {{ $objective->text }}
122
+                                                 @if ($objective->program) &nbsp;&nbsp;&nbsp;[{{ $objective->program->name }}] @endif
123
+                                ">
124
+                                    {{ $objective->text }}
128
 
125
 
129
 
126
 
130
 
127
 
131
-                            </option>
128
+                                </option>
132
                             @endforeach
129
                             @endforeach
133
                         </select>
130
                         </select>
134
                     </div>
131
                     </div>
135
                     <hr>
132
                     <hr>
136
 
133
 
137
-                    <!-- Associated Outcome -->
134
+                    <!-- Associated Learning Outcome -->
138
 
135
 
139
                     <div class="form-group">
136
                     <div class="form-group">
140
                         <div id='assocOutcomeGroup'>
137
                         <div id='assocOutcomeGroup'>
141
-                            <label>Associated Outcome</label>
138
+                            <label>Associated Learning Outcome</label>
142
 
139
 
143
                             <select id="assoc_outcome0" name="assoc_outcome[]" class="form-control selectpicker">
140
                             <select id="assoc_outcome0" name="assoc_outcome[]" class="form-control selectpicker">
144
                                 @foreach ($outcomes as $outcome)
141
                                 @foreach ($outcomes as $outcome)
160
                         <span class='glyphicon glyphicon-plus'>
157
                         <span class='glyphicon glyphicon-plus'>
161
 
158
 
162
                         </span>
159
                         </span>
163
-                        Add another Outcome
160
+                        Add another Learning Outcome
164
                     </button>
161
                     </button>
165
 
162
 
166
 
163
 
170
 
167
 
171
                         {{ Form::label('program_id2', 'Associated Program') }}<br><br>
168
                         {{ Form::label('program_id2', 'Associated Program') }}<br><br>
172
                         @foreach ($programs as $program)
169
                         @foreach ($programs as $program)
173
-
174
                             <input type="checkbox" id="assoc_program_id_{{ $program->id }}" name="assoc_program_id[]"
170
                             <input type="checkbox" id="assoc_program_id_{{ $program->id }}" name="assoc_program_id[]"
175
                                 value="{{ $program->id }}">
171
                                 value="{{ $program->id }}">
176
                             <label for="assoc_program_id_{{ $program->id }}"> {{ $program->name }}
172
                             <label for="assoc_program_id_{{ $program->id }}"> {{ $program->name }}
254
 
250
 
255
         var counter = 1;
251
         var counter = 1;
256
         var counterAssoc = 1;
252
         var counterAssoc = 1;
257
-        //Add Another Outcome
253
+        //Add Another Learning Outcome
258
 
254
 
259
         function changeOutcomeHtml() {
255
         function changeOutcomeHtml() {
260
             var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
256
             var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
405
                     if (json.assessment.length) {
401
                     if (json.assessment.length) {
406
                         $('#deleteObj').html(
402
                         $('#deleteObj').html(
407
                             "<p>This objective is currently participating in an assessment, therefore it cannot be deleted</p>"
403
                             "<p>This objective is currently participating in an assessment, therefore it cannot be deleted</p>"
408
-                            );
404
+                        );
409
                     } else if (json.assoc_criteria.length) {
405
                     } else if (json.assoc_criteria.length) {
410
                         modal =
406
                         modal =
411
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
407
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +

+ 911
- 925
app/views/local/managers/admins/transformativeAction.blade.php
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 1
- 1
app/views/local/managers/pCoords/_new_navigation.blade.php Прегледај датотеку

69
                     <h6 class="dropdown-header">View Annual Plan from:</h6>
69
                     <h6 class="dropdown-header">View Annual Plan from:</h6>
70
                     @foreach (Auth::user()->programs as $program)
70
                     @foreach (Auth::user()->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>

+ 5
- 4
app/views/local/managers/shared/annual-plans.blade.php Прегледај датотеку

1349
                     // Create button to print report
1349
                     // Create button to print report
1350
 
1350
 
1351
                     div_btn_group = $('<div>', {
1351
                     div_btn_group = $('<div>', {
1352
-                        'class': 'btn-group',
1352
+                        'class': 'btn-group-vertical',
1353
                         'role': 'group'
1353
                         'role': 'group'
1354
                     });
1354
                     });
1355
                     button_save = $('<button>', {
1355
                     button_save = $('<button>', {
1500
                             'onclick': "postAnnualPlan(" + annual_id + ")"
1500
                             'onclick': "postAnnualPlan(" + annual_id + ")"
1501
 
1501
 
1502
 
1502
 
1503
-                        }).html("Submit Annual Report");
1503
+                        }).html("Submit Annual Plan");
1504
 
1504
 
1505
                         $("#submit-modal-title").html("Are you sure you want to submit this report?");
1505
                         $("#submit-modal-title").html("Are you sure you want to submit this report?");
1506
                         $("#submit-modal-body")
1506
                         $("#submit-modal-body")
1507
                             .html(
1507
                             .html(
1508
-                                "You can submit again later, but may need to give explination to administration on why was it resubmitted"
1508
+                                "You can submit again later, but may need to give explination to administration on why was it resubmitted." +
1509
+                                "When submitting, please be patient. It may take a while. "
1509
                             );
1510
                             );
1510
 
1511
 
1511
                         $('#submit-modal-footer').html(button);
1512
                         $('#submit-modal-footer').html(button);
1540
                         }).html('<span aria-hidden="true">×</span>');
1541
                         }).html('<span aria-hidden="true">×</span>');
1541
                         alert.append(button);
1542
                         alert.append(button);
1542
                         alert.append(
1543
                         alert.append(
1543
-                            '<strong>The plan was submitted. You can check it out in View Annual Plans or Print Plan </strong>'
1544
+                            '<strong>The Annual Plan was submitted. You can check it out in View Annual Plans or Print Plan </strong>'
1544
                         )
1545
                         )
1545
                         alert.appendTo($("#alert-for-save"));
1546
                         alert.appendTo($("#alert-for-save"));
1546
                     }
1547
                     }

+ 14
- 13
app/views/local/managers/shared/annual_report.blade.php Прегледај датотеку

35
 
35
 
36
             </div>
36
             </div>
37
             <hr>
37
             <hr>
38
-            <div id="printButton"></div>
38
+            <div id="printButton" class="text-center"></div>
39
         </div>
39
         </div>
40
 
40
 
41
 
41
 
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>
1576
 
1576
 
1577
                     //create button for print
1577
                     //create button for print
1578
                     div_btn_group = $('<div>', {
1578
                     div_btn_group = $('<div>', {
1579
-                        'class': 'btn-group',
1579
+                        'class': 'btn-group-vertical',
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 ',
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 ',
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') }}" +
1766
                         $("#submit-modal-title").html("Are you sure you want to submit this report?");
1766
                         $("#submit-modal-title").html("Are you sure you want to submit this report?");
1767
                         $("#submit-modal-body")
1767
                         $("#submit-modal-body")
1768
                             .html(
1768
                             .html(
1769
-                                "You can submit again later, but may need to give explination to administration on why was it resubmitted"
1769
+                                "You can submit again later, but may need to give explination to administration on why was it resubmitted." +
1770
+                                "When submitting, please be patient. It may take a while."
1770
                             );
1771
                             );
1771
 
1772
 
1772
                         $('#submit-modal-footer').html(button);
1773
                         $('#submit-modal-footer').html(button);
1802
                         alert.append(button);
1803
                         alert.append(button);
1803
                         alert.append(
1804
                         alert.append(
1804
                             '<strong>Report is complete, You can check it out in View Annual Reports or Print Report </strong>'
1805
                             '<strong>Report is complete, You can check it out in View Annual Reports or Print Report </strong>'
1805
-                            )
1806
+                        )
1806
                         alert.appendTo($("#alert-for-save"));
1807
                         alert.appendTo($("#alert-for-save"));
1807
                     }
1808
                     }
1808
 
1809
 

+ 93
- 93
app/views/local/managers/shared/criteria.blade.php Прегледај датотеку

1
 @extends('layouts.master')
1
 @extends('layouts.master')
2
 
2
 
3
 @section('navigation')
3
 @section('navigation')
4
-@if(Auth::user()->role == 1)
5
-@include('local.managers.admins._navigation')
6
-
7
-@elseif(Auth::user()->role == 2)
8
-@include('local.managers.sCoords._new_navigation')
9
-
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')
10
     @elseif(Auth::user()->role == 3)
8
     @elseif(Auth::user()->role == 3)
11
-    @include('local.managers.pCoords._new_navigation')
9
+        @include('local.managers.pCoords._new_navigation')
12
     @endif
10
     @endif
13
 @stop
11
 @stop
14
 @section('main')
12
 @section('main')
15
 
13
 
16
     <div class="row">
14
     <div class="row">
17
-        
15
+
18
         <div class="col-md-6">
16
         <div class="col-md-6">
19
             <!-- Form to add a new criterion -->
17
             <!-- Form to add a new criterion -->
20
             <div class="panel panel-default panel-button">
18
             <div class="panel panel-default panel-button">
28
                             <div class="form-group col-md-12 selectOutcome">
26
                             <div class="form-group col-md-12 selectOutcome">
29
                                 <label>Outcome 1</label>
27
                                 <label>Outcome 1</label>
30
 
28
 
31
-                                {{ Form::select('outcome[]', $outcomes, reset($outcomes), ['class' => 'form-control selectpicker', 'id' => 'outcome0', 'onchange' => 'fetchObjectiveForSelect("outcome0", "objectiveGroupFor0")']) }}
29
+                                {{ Form::select('outcome[]', $outcomes, reset($outcomes), ['class' => 'form-control selectpicker','id' => 'outcome0','onchange' => 'fetchObjectiveForSelect("outcome0", "objectiveGroupFor0")']) }}
32
                             </div>
30
                             </div>
33
 
31
 
34
                             <div id='objectiveGroupFor0' class='createObjective' data-value='1'>
32
                             <div id='objectiveGroupFor0' class='createObjective' data-value='1'>
35
                                 <div class="form-group col-md-11 selectObjective">
33
                                 <div class="form-group col-md-11 selectObjective">
36
                                     <label>Associated Objectives for Outcome 1</label>
34
                                     <label>Associated Objectives for Outcome 1</label>
37
                                     <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker"
35
                                     <select id="objective_0_counter_1" name="objective[]" class="form-control selectpicker"
38
-                                    onchange="visiblePrograms('allOutcomes')">
36
+                                        onchange="visiblePrograms('allOutcomes')">
39
                                     </select>
37
                                     </select>
40
 
38
 
41
                                 </div>
39
                                 </div>
52
                             </button>
50
                             </button>
53
 
51
 
54
                             <br>
52
                             <br>
55
-                        
56
-                        <hr>
57
-                    </div>
58
 
53
 
59
-</div>
54
+                            <hr>
55
+                        </div>
56
+
57
+                    </div>
60
 
58
 
61
                     <input type='hidden' name='counterOutcome' id='counterOutcome' value=1>
59
                     <input type='hidden' name='counterOutcome' id='counterOutcome' value=1>
62
 
60
 
71
                     <div class="form-group form_validation program_form" id='program-checkboxes'>
69
                     <div class="form-group form_validation program_form" id='program-checkboxes'>
72
                         {{ Form::label('program_id', 'Associated Program') }}<br>
70
                         {{ Form::label('program_id', 'Associated Program') }}<br>
73
                         <br>
71
                         <br>
74
-                        @if(count($programs) ==1)
75
-                        <input type="checkbox" id="program-{{ $programs[0]->name }}" name="program_id[]"
76
-                        value="{{ $programs[0]->id }}"  checked>
77
-                    <label for="program-{{ $programs[0]->name }}"> {{ $programs[0]->name }}
78
-                        [{{ $programs[0]->school->name }}]</label><br>
79
-                        <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
80
-                            value="{{ $programs[0]->id }}">
81
-    
72
+                        @if (count($programs) == 1)
73
+                            <input type="checkbox" id="program-{{ $programs[0]->name }}" name="program_id[]"
74
+                                value="{{ $programs[0]->id }}" checked>
75
+                            <label for="program-{{ $programs[0]->name }}"> {{ $programs[0]->name }}
76
+                                [{{ $programs[0]->school->name }}]</label><br>
77
+                            <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
78
+                                value="{{ $programs[0]->id }}">
82
                         @else
79
                         @else
83
-                  @foreach ($programs as $program)
84
-                         <input type="checkbox" id="program-{{ $program->id }}" name="program_id[]"
85
-                            value="{{ $program->id }}">
86
-                        <label for="program-{{ $program->id }}"> {{ $program->name }}
87
-                            [{{ $program->school->name }}]</label><br>
80
+                            @foreach ($programs as $program)
81
+                                <input type="checkbox" id="program-{{ $program->id }}" name="program_id[]"
82
+                                    value="{{ $program->id }}">
83
+                                <label for="program-{{ $program->id }}"> {{ $program->name }}
84
+                                    [{{ $program->school->name }}]</label><br>
88
                             @endforeach
85
                             @endforeach
89
 
86
 
90
-                    @endif
87
+                        @endif
91
                     </div>
88
                     </div>
92
 
89
 
93
                     <div class="form-group form_validation name_form">
90
                     <div class="form-group form_validation name_form">
98
                     <div class="form-group">
95
                     <div class="form-group">
99
                         {{ Form::label('subcriteria', 'Subcriteria') }}
96
                         {{ Form::label('subcriteria', 'Subcriteria') }}
100
                         <p class="help-block"><strong>Manually add</strong> bullets or numbering.</p>
97
                         <p class="help-block"><strong>Manually add</strong> bullets or numbering.</p>
101
-                        {{ Form::textarea('subcriteria', '', ['class' => 'form-control', 'rows' => 3, 'aria-labelledby' => 'subcriteria']) }}
98
+                        {{ Form::textarea('subcriteria', '', ['class' => 'form-control','rows' => 3,'aria-labelledby' => 'subcriteria']) }}
102
                     </div>
99
                     </div>
103
                     <div class="form-group form_validation maximum_form">
100
                     <div class="form-group form_validation maximum_form">
104
                         {{ Form::label('maximum_score', 'Maximum Score') }}
101
                         {{ Form::label('maximum_score', 'Maximum Score') }}
105
-                        {{ Form::text('maximum_score', '8', ['class' => 'form-control', 'id' => 'maximum_score', 'oninput' => 'addOptions("Num_scale", "maximum_score", "Scales")']) }}
102
+                        {{ Form::text('maximum_score', '8', ['class' => 'form-control','id' => 'maximum_score','oninput' => 'addOptions("Num_scale", "maximum_score", "Scales")']) }}
106
                     </div>
103
                     </div>
107
                     <div class="form-group form_validation number_of_scales">
104
                     <div class="form-group form_validation number_of_scales">
108
                         {{ Form::label('scales', 'Number of Scales') }}
105
                         {{ Form::label('scales', 'Number of Scales') }}
118
 
115
 
119
                     <div class="form-group">
116
                     <div class="form-group">
120
                         {{ Form::label('copyright', 'Copyright') }}
117
                         {{ Form::label('copyright', 'Copyright') }}
121
-                        {{ Form::textarea('copyright', '', ['class' => 'form-control', 'rows' => 2, 'placeholder' => '(optional)', 'aria-labelledby' => 'copyright']) }}
118
+                        {{ Form::textarea('copyright', '', ['class' => 'form-control','rows' => 2,'placeholder' => '(optional)','aria-labelledby' => 'copyright']) }}
122
                     </div>
119
                     </div>
123
 
120
 
124
                     <div class="form-group">
121
                     <div class="form-group">
125
                         {{ Form::label('notes', 'Notes') }}
122
                         {{ Form::label('notes', 'Notes') }}
126
-                        {{ Form::textarea('notes', '', ['class' => 'form-control', 'rows' => 2, 'placeholder' => '(optional)', 'aria-labelledby' => 'notes']) }}
123
+                        {{ Form::textarea('notes', '', ['class' => 'form-control','rows' => 2,'placeholder' => '(optional)','aria-labelledby' => 'notes']) }}
127
                     </div>
124
                     </div>
128
 
125
 
129
-                    {{ Form::submit('Create', ['class' => 'btn btn-primary btn-block', 'id' => 'create_the_criterion_button', 'data-form-id' => 'create_criterion']) }}
126
+                    {{ Form::submit('Create', ['class' => 'btn btn-primary btn-block','id' => 'create_the_criterion_button','data-form-id' => 'create_criterion']) }}
130
                     {{ Form::close() }}
127
                     {{ Form::close() }}
131
                 </div>
128
                 </div>
132
             </div>
129
             </div>
138
                     Edit
135
                     Edit
139
                 </div>
136
                 </div>
140
                 <div class="panel-body">
137
                 <div class="panel-body">
141
-                    {{ Form::open(['action' => 'CriteriaController@update', 'id' => 'update_criterion', 'data-form-id' => 'update_criterion']) }}
138
+                    {{ Form::open(['action' => 'CriteriaController@update','id' => 'update_criterion','data-form-id' => 'update_criterion']) }}
142
 
139
 
143
                     <button class="btn btn-md btn-secondary filterButton">
140
                     <button class="btn btn-md btn-secondary filterButton">
144
                         <span class="glyphicon glyphicon-minus">
141
                         <span class="glyphicon glyphicon-minus">
160
                         </div>
157
                         </div>
161
                         <div class="form-group">
158
                         <div class="form-group">
162
                             <label>Associated Outcome</label>
159
                             <label>Associated Outcome</label>
163
-                            {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class' => 'form-control selectpicker', 'id' => 'assoc_outcomes_fetch', 'onchange' => 'fetchAllCriterion("select-program", "assoc_outcomes_fetch")']) }}
160
+                            {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class' => 'form-control selectpicker','id' => 'assoc_outcomes_fetch','onchange' => 'fetchAllCriterion("select-program", "assoc_outcomes_fetch")']) }}
164
 
161
 
165
                         </div>
162
                         </div>
166
                     </div>
163
                     </div>
170
                         {{ Form::label('criterion_id', 'Criterion') }}
167
                         {{ Form::label('criterion_id', 'Criterion') }}
171
                         <select id="select-criterion" name="id" class="form-control selectpicker"
168
                         <select id="select-criterion" name="id" class="form-control selectpicker"
172
                             onchange='fetchCriterionForEditing()'>
169
                             onchange='fetchCriterionForEditing()'>
173
-                          
170
+
174
                         </select>
171
                         </select>
175
                     </div>
172
                     </div>
176
                     <div id='allAssocOutcomes' class='form_validation outcome_form'>
173
                     <div id='allAssocOutcomes' class='form_validation outcome_form'>
178
                         <div id='assocOutcomeGroup0' class='createOutcome' data-value="1">
175
                         <div id='assocOutcomeGroup0' class='createOutcome' data-value="1">
179
                             <div class="form-group col-md-12 selectOutcome">
176
                             <div class="form-group col-md-12 selectOutcome">
180
                                 <label>Outcome 1</label>
177
                                 <label>Outcome 1</label>
181
-                                {{ Form::select('outcome[]', $outcomes, null, ['class' => 'form-control selectpicker', 'id' => 'assoc_outcome_0', 'onchange' => 'fetchObjectiveForSelect("assoc_outcome_0", "assoc_objectiveGroupFor0")']) }}
178
+                                {{ Form::select('outcome[]', $outcomes, null, ['class' => 'form-control selectpicker','id' => 'assoc_outcome_0','onchange' => 'fetchObjectiveForSelect("assoc_outcome_0", "assoc_objectiveGroupFor0")']) }}
182
 
179
 
183
                             </div>
180
                             </div>
184
                             <div id='assoc_objectiveGroupFor0' class='createObjective' data-value="1">
181
                             <div id='assoc_objectiveGroupFor0' class='createObjective' data-value="1">
201
                                 </span>
198
                                 </span>
202
                                 Add another Objective
199
                                 Add another Objective
203
                             </button>
200
                             </button>
204
-                        
205
-                        <hr>
201
+
202
+                            <hr>
203
+                        </div>
206
                     </div>
204
                     </div>
207
-                </div>
208
                     <button class='btn btn-md btn-secondary button-add-outcome-assoc' onclick='addAssocOutcome()'>
205
                     <button class='btn btn-md btn-secondary button-add-outcome-assoc' onclick='addAssocOutcome()'>
209
                         <span class='glyphicon glyphicon-plus'>
206
                         <span class='glyphicon glyphicon-plus'>
210
 
207
 
216
 
213
 
217
 
214
 
218
                     <!-- Associated Program -->
215
                     <!-- Associated Program -->
219
-                    <div class="form-group form_validation program_form" id = 'assoc-program-checkboxes'>
216
+                    <div class="form-group form_validation program_form" id='assoc-program-checkboxes'>
217
+
218
+                        {{ Form::label('program_id2', 'Associated Program') }}<br><br>
220
 
219
 
221
-                            {{ Form::label('program_id2', 'Associated Program') }}<br><br>
220
+                        @if (count($programs) == 1)
222
 
221
 
223
-                            @if(count($programs) ==1)
224
-                           
225
                             <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
222
                             <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
226
-                            value="{{ $programs[0]->id }}">
227
-    
223
+                                value="{{ $programs[0]->id }}">
224
+
228
                             <input type="checkbox" id="assoc_program-{{ $programs[0]->id }}" name="program_id[]"
225
                             <input type="checkbox" id="assoc_program-{{ $programs[0]->id }}" name="program_id[]"
229
-                                value="{{ $programs[0]->id }}"  checked>
226
+                                value="{{ $programs[0]->id }}" checked>
230
                             <label for="assoc_program-{{ $programs[0]->id }}"> {{ $programs[0]->name }}
227
                             <label for="assoc_program-{{ $programs[0]->id }}"> {{ $programs[0]->name }}
231
                                 <sub>[{{ $programs[0]->school->name }}]</sub></label><br>
228
                                 <sub>[{{ $programs[0]->school->name }}]</sub></label><br>
232
-    
233
                         @else
229
                         @else
234
-                  @foreach ($programs as $program)
235
-                         <input type="checkbox" id="assoc_program-{{ $program->id }}" name="program_id[]"
236
-                                value="{{ $program->id }}">
237
-                            <label for="assoc_program-{{ $program->id }}"> {{ $program->name }}
238
-                                <sub>[{{ $program->school->name }}]</sub></label><br>
239
-                       
230
+                            @foreach ($programs as $program)
231
+                                <input type="checkbox" id="assoc_program-{{ $program->id }}" name="program_id[]"
232
+                                    value="{{ $program->id }}">
233
+                                <label for="assoc_program-{{ $program->id }}"> {{ $program->name }}
234
+                                    <sub>[{{ $program->school->name }}]</sub></label><br>
240
                             @endforeach
235
                             @endforeach
241
 
236
 
242
-                    @endif
237
+                        @endif
238
+
243
 
239
 
244
-                            
245
                     </div>
240
                     </div>
246
 
241
 
247
 
242
 
272
                     </div>
267
                     </div>
273
                     <div class="form-group form_validation maximum_form">
268
                     <div class="form-group form_validation maximum_form">
274
                         {{ Form::label('maximum_score', 'Maximum Score') }}
269
                         {{ Form::label('maximum_score', 'Maximum Score') }}
275
-                        {{ Form::text('maximum_score', '', ['class' => 'form-control', 'id' => 'assoc_maximum_score', 'oninput' => 'addOptions("Num_assoc_scale", "assoc_maximum_score", "Assoc_Scales")']) }}
270
+                        {{ Form::text('maximum_score', '', ['class' => 'form-control','id' => 'assoc_maximum_score','oninput' => 'addOptions("Num_assoc_scale", "assoc_maximum_score", "Assoc_Scales")']) }}
276
                     </div>
271
                     </div>
277
 
272
 
278
 
273
 
292
 
287
 
293
                     <div class="form-group">
288
                     <div class="form-group">
294
                         {{ Form::label('copyright', 'Copyright Information') }}
289
                         {{ Form::label('copyright', 'Copyright Information') }}
295
-                        {{ Form::textarea('copyright', Input::old('copyright'), ['class' => 'form-control', 'rows' => 2, 'id' => 'criterion_copyright', 'placeholder' => '(optional)']) }}
290
+                        {{ Form::textarea('copyright', Input::old('copyright'), ['class' => 'form-control','rows' => 2,'id' => 'criterion_copyright','placeholder' => '(optional)']) }}
296
                     </div>
291
                     </div>
297
 
292
 
298
                     <div class="form-group">
293
                     <div class="form-group">
299
                         {{ Form::label('notes', 'Additional Notes') }}
294
                         {{ Form::label('notes', 'Additional Notes') }}
300
-                        {{ Form::textarea('notes', Input::old('notes'), ['class' => 'form-control', 'rows' => 2, 'id' => 'criterion_notes', 'placeholder' => '(optional)']) }}
295
+                        {{ Form::textarea('notes', Input::old('notes'), ['class' => 'form-control','rows' => 2,'id' => 'criterion_notes','placeholder' => '(optional)']) }}
301
                     </div>
296
                     </div>
302
 
297
 
303
-                    {{ Form::submit('Update', ['class' => 'btn btn-primary btn-block', 'id' => 'update_the_criterion_button', 'data-form-id' => 'update_criterion']) }}
298
+                    {{ Form::submit('Update', ['class' => 'btn btn-primary btn-block','id' => 'update_the_criterion_button','data-form-id' => 'update_criterion']) }}
304
                     {{ Form::close() }}
299
                     {{ Form::close() }}
305
-                    {{ Form::open(['action' => 'CriteriaController@delete']) }}
300
+                    {{ Form::open(['action' => 'CriteriaController@delete', 'id' => 'deleteCriterionForm']) }}
306
 
301
 
307
-                    <input type='hidden' name='criterion_delete' id='deleteCriteria'>
302
+                    {{ Form::hidden('criterion_delete', '0', ['id' => 'deleteCriteria']) }}
303
+                    <!--<input type='hidden' name='criterion_delete' id='deleteCriteria'>-->
308
 
304
 
309
                     {{ Form::submit('Delete', ['class' => 'btn btn-primary btn-block', 'id' => 'DeleteButton']) }}
305
                     {{ Form::submit('Delete', ['class' => 'btn btn-primary btn-block', 'id' => 'DeleteButton']) }}
306
+                    {{ Form::close() }}
310
 
307
 
311
                 </div>
308
                 </div>
312
             </div>
309
             </div>
323
             addOptions('Num_scale', 'maximum_score', 'Scales');
320
             addOptions('Num_scale', 'maximum_score', 'Scales');
324
             $('#Num_scale').val('4');
321
             $('#Num_scale').val('4');
325
             numberOfScales('Num_scale', 'Scales');
322
             numberOfScales('Num_scale', 'Scales');
326
-            
323
+
327
             $('.selectpicker').selectpicker('refresh');
324
             $('.selectpicker').selectpicker('refresh');
328
-            
325
+
329
         });
326
         });
330
 
327
 
331
-        function checkIfNewCriterion(scaleBox){
332
-            if ( $(scaleBox).val() == $(scaleBox).data('old-scale') ){
328
+        function checkIfNewCriterion(scaleBox) {
329
+            if ($(scaleBox).val() == $(scaleBox).data('old-scale')) {
330
+
333
 
331
 
334
-                
335
 
332
 
336
-                $('#DeleteButton').prop('disabled', false);
333
+                //$('#DeleteButton').prop('disabled', false);
337
                 $("#update_the_criterion_button").val('Update');
334
                 $("#update_the_criterion_button").val('Update');
338
                 $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@update') }}")
335
                 $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@update') }}")
339
-                
340
-                $(scaleBox).parent().children('.alert-placeholder').remove();
341
-            }
342
 
336
 
343
-
344
-             else {
345
-                if( $(scaleBox).parent().children('.alert-placeholder').length===0){
346
-                    div_placeholder = $('<div>',{
347
-                        'class':'alert-placeholder'
337
+                $(scaleBox).parent().children('.alert-placeholder').remove();
338
+            } else {
339
+                if ($(scaleBox).parent().children('.alert-placeholder').length === 0) {
340
+                    div_placeholder = $('<div>', {
341
+                        'class': 'alert-placeholder'
348
                     });
342
                     });
349
                     $(div_placeholder).html(
343
                     $(div_placeholder).html(
350
                         '<div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>Warning!</strong> If a criterion is already used in assessments, editting it will actually create a new one </div>'
344
                         '<div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <strong>Warning!</strong> If a criterion is already used in assessments, editting it will actually create a new one </div>'
353
 
347
 
354
                 }
348
                 }
355
 
349
 
356
-                $('#DeleteButton').prop('disabled', true);
350
+                //$('#DeleteButton').prop('disabled', true);
357
                 $("#update_the_criterion_button").val("Create New")
351
                 $("#update_the_criterion_button").val("Create New")
358
                 $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
352
                 $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
359
-                
353
+
360
 
354
 
361
 
355
 
362
             }
356
             }
363
         }
357
         }
358
+
364
         function fetchCriterionForEditing() {
359
         function fetchCriterionForEditing() {
365
             var id = $('#select-criterion').find(':selected').val();
360
             var id = $('#select-criterion').find(':selected').val();
366
 
361
 
383
 
378
 
384
                     } else {
379
                     } else {
385
                         criterion = criterion[0];
380
                         criterion = criterion[0];
386
-                        
381
+
387
                         var name = criterion.name;
382
                         var name = criterion.name;
388
                         if (criterion.subcriteria) {
383
                         if (criterion.subcriteria) {
389
                             subcriteria = JSON.parse(criterion.subcriteria).join('\n');
384
                             subcriteria = JSON.parse(criterion.subcriteria).join('\n');
417
                             $('#assoc_scale_' + i).val(criterion.scales[i].description);
412
                             $('#assoc_scale_' + i).val(criterion.scales[i].description);
418
                         }
413
                         }
419
                         if ((criterion.activity_criterion.length)) {
414
                         if ((criterion.activity_criterion.length)) {
420
-                            for(i = 0; i<criterion.num_scales; i++){
421
-                                $("#assoc_scale_"+i).attr('oninput','checkIfNewCriterion(this)')
422
-                                $("#assoc_scale_"+i).data('old-scale', $('#assoc_scale_'+i).val())
415
+                            for (i = 0; i < criterion.num_scales; i++) {
416
+                                $("#assoc_scale_" + i).attr('oninput', 'checkIfNewCriterion(this)')
417
+                                $("#assoc_scale_" + i).data('old-scale', $('#assoc_scale_' + i).val())
423
                             }
418
                             }
424
 
419
 
420
+                            $('#DeleteButton').prop('disabled', true);
421
+
425
 
422
 
426
 
423
 
427
-                            
428
-                            
429
 
424
 
425
+
426
+                        } else {
427
+                            $('#DeleteButton').prop('disabled', false);
430
                         }
428
                         }
431
 
429
 
432
 
430
 
629
 
627
 
630
 
628
 
631
                     */
629
                     */
632
-                            visiblePrograms('allAssocOutcomes');
630
+                    visiblePrograms('allAssocOutcomes');
633
 
631
 
634
                     var program_length = criterion.program.length;
632
                     var program_length = criterion.program.length;
635
-                    
636
-                        $('input[type=checkbox]').prop('checked', false);
637
-                        for (var i = 0; i < program_length; i++) {
633
+
634
+                    $('input[type=checkbox]').prop('checked', false);
635
+                    for (var i = 0; i < program_length; i++) {
638
                         $('#assoc_program-' + criterion.program[i].program_id).prop("checked", true);
636
                         $('#assoc_program-' + criterion.program[i].program_id).prop("checked", true);
639
                     }
637
                     }
640
-                    
641
-                  
638
+
639
+
640
+                    $("#deleteCriteria").val(criterion.id);
641
+
642
+
642
 
643
 
643
 
644
 
644
 
645
 
896
                     e.preventDefault();
897
                     e.preventDefault();
897
 
898
 
898
 
899
 
900
+            } else if (e.originalEvent.submitter.id == "DeleteButton") {
901
+
899
             } else e.preventDefault();
902
             } else e.preventDefault();
900
         })
903
         })
901
 
904
 
1653
                 }
1656
                 }
1654
             )
1657
             )
1655
         }
1658
         }
1656
-
1657
-
1658
-        
1659
     </script>
1659
     </script>
1660
 @stop
1660
 @stop
1661
 
1661
 

+ 89
- 0
app/views/local/managers/shared/new_view_annual_plans.blade.php Прегледај датотеку

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>Annual 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->academic_year }}</td>
44
+                                <td> <a
45
+                                        href="{{ URL::action('AnnualPlansController@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('AnnualPlansController@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

+ 167
- 67
app/views/local/managers/shared/objectives.blade.php Прегледај датотеку

1
 @extends('layouts.master')
1
 @extends('layouts.master')
2
 
2
 
3
 @section('navigation')
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
-@endif
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
+    @endif
11
 @stop
11
 @stop
12
 @section('main')
12
 @section('main')
13
     <div class="row">
13
     <div class="row">
25
                 <div class="panel-body">
25
                 <div class="panel-body">
26
                     {{ Form::open(['action' => 'Objective2Controller@create']) }}
26
                     {{ Form::open(['action' => 'Objective2Controller@create']) }}
27
                     <div id='outcomeGroup'>
27
                     <div id='outcomeGroup'>
28
-                        <label> Associated Outcome</label>
28
+                        <label> Associated Learning Outcome</label>
29
                         <div class="form-group col-md-11" id='outcomeForm'>
29
                         <div class="form-group col-md-11" id='outcomeForm'>
30
 
30
 
31
 
31
 
32
                             <select id="outcome[0]" name="outcome[0]" class="form-control selectpicker">
32
                             <select id="outcome[0]" name="outcome[0]" class="form-control selectpicker">
33
 
33
 
34
                                 @foreach ($outcomes as $outcome)
34
                                 @foreach ($outcomes as $outcome)
35
-
36
                                     <option value="{{ $outcome->id }}">
35
                                     <option value="{{ $outcome->id }}">
37
 
36
 
38
                                         {{ $outcome->name }}
37
                                         {{ $outcome->name }}
44
 
43
 
45
 
44
 
46
                                     </option>
45
                                     </option>
47
-
48
                                 @endforeach
46
                                 @endforeach
49
 
47
 
50
                             </select>
48
                             </select>
58
                         <span class='glyphicon glyphicon-plus'>
56
                         <span class='glyphicon glyphicon-plus'>
59
 
57
 
60
                         </span>
58
                         </span>
61
-                        Add another Outcome
59
+                        Add another Learning Outcome
62
                     </button>
60
                     </button>
63
 
61
 
64
                     <!-- Associated Program -->
62
                     <!-- Associated Program -->
69
                         <br>
67
                         <br>
70
 
68
 
71
 
69
 
72
-                            @foreach ($programs as $program)
73
-
70
+                        @foreach ($programs as $program)
74
                             <input type="checkbox" id="{{ $program->name }}" name="program_id[]"
71
                             <input type="checkbox" id="{{ $program->name }}" name="program_id[]"
75
                                 value="{{ $program->id }}">
72
                                 value="{{ $program->id }}">
76
                             <label for="{{ $program->name }}"> {{ $program->name }}
73
                             <label for="{{ $program->name }}"> {{ $program->name }}
120
                             </select>
117
                             </select>
121
                         </div>
118
                         </div>
122
                         <div class="form-group">
119
                         <div class="form-group">
123
-                            <label>Associated Outcome</label>
120
+                            <label>Associated Learning Outcome</label>
124
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
121
                             {{-- Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) --}}
125
                             <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
122
                             <select id="assoc_outcomes_fetch" name="assoc_outcome_fetch" class="form-control selectpicker"
126
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
123
                                 onchange="fetchAllObjectives('select-program', 'assoc_outcomes_fetch')">
142
                         {{ Form::label('objective_id', 'Objectives') }}
139
                         {{ Form::label('objective_id', 'Objectives') }}
143
                         <select id="select-objective" name='id' class="form-control selectpicker">
140
                         <select id="select-objective" name='id' class="form-control selectpicker">
144
                             @foreach ($objectives as $objective)
141
                             @foreach ($objectives as $objective)
145
-                                <option value="{{ $objective->id }}" data-subtext="
146
-                                             @if ($objective->program)
147
-                                    &nbsp;&nbsp;&nbsp;[{{ $objective->program->name }}]
148
-                            @endif
149
-                            ">
150
-                            {{ $objective->text }}
142
+                                <option value="{{ $objective->id }}"
143
+                                    data-subtext="
144
+                                                                                                                                                                                                                             @if ($objective->program) &nbsp;&nbsp;&nbsp;[{{ $objective->program->name }}] @endif
145
+                                                                                                                                                                                                            ">
146
+                                    {{ $objective->text }}
151
 
147
 
152
 
148
 
153
 
149
 
154
-                            </option>
150
+                                </option>
155
                             @endforeach
151
                             @endforeach
156
                         </select>
152
                         </select>
157
 
153
 
162
 
158
 
163
                     <div class="form-group">
159
                     <div class="form-group">
164
                         <div id='assocOutcomeGroup'>
160
                         <div id='assocOutcomeGroup'>
165
-                            <label>Associated Outcome</label>
161
+                            <label>Associated Learning Outcome</label>
162
+
163
+                            <div id="message_to_disconnect"></div>
166
 
164
 
167
                             <select id="assoc_outcome0" name="assoc_outcome[]" class="form-control selectpicker">
165
                             <select id="assoc_outcome0" name="assoc_outcome[]" class="form-control selectpicker">
168
 
166
 
169
                                 @foreach ($outcomes as $outcome)
167
                                 @foreach ($outcomes as $outcome)
170
-
171
                                     <option value="{{ $outcome->id }}">
168
                                     <option value="{{ $outcome->id }}">
172
 
169
 
173
                                         {{ $outcome->name }}
170
                                         {{ $outcome->name }}
179
 
176
 
180
 
177
 
181
                                     </option>
178
                                     </option>
182
-
183
                                 @endforeach
179
                                 @endforeach
184
 
180
 
185
                             </select>
181
                             </select>
193
                         <span class='glyphicon glyphicon-plus'>
189
                         <span class='glyphicon glyphicon-plus'>
194
 
190
 
195
                         </span>
191
                         </span>
196
-                        Add another Outcome
192
+                        Add another Learning Outcome
197
                     </button>
193
                     </button>
198
 
194
 
199
 
195
 
204
 
200
 
205
 
201
 
206
                         @foreach ($programs as $program)
202
                         @foreach ($programs as $program)
207
-
208
-                        <input type="checkbox" id="assoc_program_id_{{ $program->id }}" name="assoc_program_id[]"
209
-                            value="{{ $program->id }}">
210
-                        <label for="assoc_program_id_{{ $program->id }}"> {{ $program->name }}
211
-                            <sub>[{{ $program->school->name }}]</sub></label><br>
212
-                    @endforeach
203
+                            <input type="checkbox" id="assoc_program_id_{{ $program->id }}" name="assoc_program_id[]"
204
+                                value="{{ $program->id }}">
205
+                            <label for="assoc_program_id_{{ $program->id }}"> {{ $program->name }}
206
+                                <sub>[{{ $program->school->name }}]</sub></label><br>
207
+                        @endforeach
213
                     </div>
208
                     </div>
214
 
209
 
215
                     <!-- Status -->
210
                     <!-- Status -->
233
 
228
 
234
                     </div>
229
                     </div>
235
 
230
 
236
-                    {{ Form::submit('Update', ['class' => 'btn btn-primary btn-block', 'id' => 'update_button']) }}
231
+                    {{ Form::submit('Update', ['class' => 'btn btn-primary btn-block', 'id' => 'update_button_to_modal']) }}
237
                     {{ Form::close() }}
232
                     {{ Form::close() }}
238
 
233
 
239
                     <form action="/deleteObjective" method="POST" id='deleteObj'>
234
                     <form action="/deleteObjective" method="POST" id='deleteObj'>
249
             </div>
244
             </div>
250
         </div>
245
         </div>
251
     </div>
246
     </div>
247
+    <div id="ObjectiveAssocModal" class="modal fade" tabindex="-1" data-criterion-id="0">
248
+        <div class="modal-dialog">
249
+            <div class="modal-content">
250
+                <div class="modal-header">
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
253
+                        this Objective?</h5>
254
+
255
+                </div>
256
+                <div class="modal-body" id="ObjectiveModalBody">
257
+
258
+                </div>
259
+                <div class="modal-footer">
260
+                    <button type="button" class="btn btn-secondary"
261
+                        onclick="pair_every_criteria_with_objective =0; $('#update_button').click()"
262
+                        data-dismiss="modal">No</button>
263
+                    <button type="button" onclick="pair_every_criteria_with_objective =1; $('#update_button').click()"
264
+                        class="btn btn-primary" data-dismiss="modal">Yes</button>
265
+                    <button type="hidden" style="display:none" id="update_button" class="btn btn-primary"></button>
266
+                </div>
267
+            </div>
268
+        </div>
269
+    </div>
252
     <script>
270
     <script>
253
         $('.filterSection').show();
271
         $('.filterSection').show();
254
 
272
 
294
         }
312
         }
295
 
313
 
296
         var counter = 1;
314
         var counter = 1;
297
-        var counterAssoc = 1;
315
+        var counterAssoc = 0;
298
         //Add Another Outcome
316
         //Add Another Outcome
299
 
317
 
300
         function changeOutcomeHtml() {
318
         function changeOutcomeHtml() {
347
                 'type': 'button',
365
                 'type': 'button',
348
                 'class': 'btn btn-primary',
366
                 'class': 'btn btn-primary',
349
                 //send the counter to the function so it can tell which container to remove
367
                 //send the counter to the function so it can tell which container to remove
350
-                'onclick': 'deleteLast()',
368
+                'onclick': 'deleteLast(' + counter + ')',
351
 
369
 
352
             });
370
             });
353
             $button.append('X');
371
             $button.append('X');
365
         }
383
         }
366
 
384
 
367
         //Recieves the counter variable so it can find the specific div and delete it
385
         //Recieves the counter variable so it can find the specific div and delete it
368
-        function deleteLast() {
386
+        function deleteLast(counter) {
369
             div = document.getElementById('outcomeContainer' + (counter).toString());
387
             div = document.getElementById('outcomeContainer' + (counter).toString());
370
             div.remove();
388
             div.remove();
371
         }
389
         }
387
 
405
 
388
 
406
 
389
                     // Select associated outcome
407
                     // Select associated outcome
390
-                    for (var i = counterAssoc; i != 1; i--) {
391
-                        deleteLastAssoc();
392
-
393
-                    }
408
+                    $(".removable-outcome").remove();
409
+                    $('.alert-dismissible').remove();
394
                     $('#assoc_outcome0').val(json.outcome[0].outcome_id);
410
                     $('#assoc_outcome0').val(json.outcome[0].outcome_id);
411
+
412
+                    disabled = 0;
413
+                    if (json.outcome[0].typ_semester_outcome_id != null || json.outcome[0].count_criterion_id != 0) {
414
+                        $('#assoc_outcome0').attr('disabled', true);
415
+                        disabled = 1;
416
+                    } else $('#assoc_outcome0').attr('disabled', false);
417
+                    counterAssoc = 0;
395
                     $('#assoc_outcome0').selectpicker('refresh');
418
                     $('#assoc_outcome0').selectpicker('refresh');
396
-                    counterAssoc = 1;
397
                     for (var i = 1; i < json.outcome.length; i++) {
419
                     for (var i = 1; i < json.outcome.length; i++) {
398
-                        counterAssoc = i + 1;
420
+                        counterAssoc = i;
399
                         var $select = $('<select />', {
421
                         var $select = $('<select />', {
400
-                            'class': "selectpicker form-control",
422
+                            'class': "selectpicker form-control ",
401
                             'name': "assoc_outcome[]",
423
                             'name': "assoc_outcome[]",
402
                             'data-live-search': 'true',
424
                             'data-live-search': 'true',
403
-                            'id': 'assoc_outcome' + i.toString()
425
+                            'id': 'assoc_outcome' + i.toString(),
426
+
404
 
427
 
405
                         });
428
                         });
406
                         var $div = $('<div />', {
429
                         var $div = $('<div />', {
407
                             'id': 'assocOutcomeForm' + i.toString(),
430
                             'id': 'assocOutcomeForm' + i.toString(),
408
-                            'class': 'form-group col-md-11'
431
+                            'class': 'form-group col-md-11 removable-outcome'
409
                         });
432
                         });
410
                         var $divForButton = $('<div />', {
433
                         var $divForButton = $('<div />', {
411
-                            'class': 'col-md-1',
434
+                            'class': 'col-md-1 removable-outcome',
412
                             'id': 'closeAssoc' + i.toString()
435
                             'id': 'closeAssoc' + i.toString()
413
 
436
 
414
                         });
437
                         });
415
                         var $button = $('<button />', {
438
                         var $button = $('<button />', {
416
                             'type': 'button',
439
                             'type': 'button',
417
-                            'class': 'btn btn-primary',
418
-                            'onclick': 'deleteLastAssoc()'
440
+                            'class': 'btn btn-primary removable-outcome',
441
+                            'onclick': 'deleteLastAssoc(' + i + ')'
419
                         });
442
                         });
420
                         $button.append('X');
443
                         $button.append('X');
421
                         $divForButton.append($button);
444
                         $divForButton.append($button);
422
 
445
 
423
                         $div.appendTo('#assocOutcomeGroup')
446
                         $div.appendTo('#assocOutcomeGroup')
424
                         $select.append(selectOptions);
447
                         $select.append(selectOptions);
425
-
448
+                        if (json.outcome[i].typ_semester_outcome_id != null || json.outcome[i].count_criterion_id !=
449
+                            0) {
450
+                            $select.attr('disabled', true);
451
+                            $button.attr('disabled', true);
452
+                            disabled = 1;
453
+                        }
426
                         $select.appendTo('#assocOutcomeForm' + i.toString()).selectpicker('refresh');
454
                         $select.appendTo('#assocOutcomeForm' + i.toString()).selectpicker('refresh');
427
                         $divForButton.appendTo('#assocOutcomeGroup');
455
                         $divForButton.appendTo('#assocOutcomeGroup');
428
 
456
 
457
+
429
                         $('#assoc_outcome' + i.toString()).val(json.outcome[i].outcome_id);
458
                         $('#assoc_outcome' + i.toString()).val(json.outcome[i].outcome_id);
430
                         $('#assoc_outcome' + i.toString()).selectpicker('refresh');
459
                         $('#assoc_outcome' + i.toString()).selectpicker('refresh');
431
 
460
 
432
 
461
 
462
+
463
+
433
                     }
464
                     }
434
 
465
 
466
+
467
+                    if (disabled == 1) {
468
+                        alert = $('<div/>', {
469
+                            'class': 'alert alert-danger alert-dismissible',
470
+                            'role': 'alert'
471
+                        })
472
+                        button = $('<button/>', {
473
+                            'type': 'button',
474
+                            'class': 'close',
475
+                            'data-dismiss': 'alert',
476
+                            'alert-label': 'close'
477
+                        }).html('<span aria-hidden="true">×</span>');
478
+                        alert.append(button);
479
+                        alert.append(
480
+                            '<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>'
481
+                        )
482
+
483
+                        alert.appendTo($('#message_to_disconnect'))
484
+                    }
485
+
486
+
487
+
435
                     var program_length = json.program.length;
488
                     var program_length = json.program.length;
436
                     $('input[type=checkbox]').prop('checked', false);
489
                     $('input[type=checkbox]').prop('checked', false);
437
 
490
 
446
                         $('#status').val(0);
499
                         $('#status').val(0);
447
                     else
500
                     else
448
                         $('#status').val(1);
501
                         $('#status').val(1);
502
+                    typ_status = "";
503
+
504
+                    warning = "";
449
 
505
 
450
-                    if (json.assessment.length) {
506
+                    if (json.typ_semester_objectives.length > 0 && json.assessment.length > 0) {
507
+                        warning =
508
+                            "<p>This objective is currently participating in an Assessment and it is paired to a Three Year Plan, therefore it cannot be deleted </p>";
509
+                        $("#deleteObj").html(warning);
510
+                    } else if (json.assessment.length > 0) {
451
                         $('#deleteObj').html(
511
                         $('#deleteObj').html(
452
-                            "<p>This objective is currently participating in an assessment, therefore it cannot be deleted</p>"
453
-                            );
454
-                    } else if (json.assoc_criteria.length) {
512
+                            "<p>This objective is currently participating in an Assessment, therefore it cannot be deleted</p>"
513
+                        );
514
+                    } else if (json.typ_semester_objectives.length > 0) {
515
+                        warning =
516
+                            "<p>This objective is currently paired to a Three Year Plan, therefore it cannot be deleted </p>";
517
+                        $("#deleteObj").html(
518
+                            warning
519
+                        );
520
+                    } else if (json.assoc_criteria.length > 0) {
455
                         modal =
521
                         modal =
456
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
522
                             '<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#delete">' +
457
                             'Delete' +
523
                             'Delete' +
523
         }
589
         }
524
 
590
 
525
 
591
 
526
-        function deleteLastAssoc() {
592
+        function deleteLastAssoc(i) {
527
 
593
 
528
-            div = document.getElementById('assocOutcomeForm' + (counterAssoc - 1).toString());
594
+            div = document.getElementById('assocOutcomeForm' + (i).toString());
529
             div.remove();
595
             div.remove();
530
-            button = document.getElementById('closeAssoc' + (counterAssoc - 1).toString());
596
+            button = document.getElementById('closeAssoc' + (i).toString());
531
             button.remove();
597
             button.remove();
532
-            counterAssoc -= 1;
533
-            $('#counterAssoc').val(counterAssoc);
598
+            //counterAssoc -= 1;
599
+            //$('#counterAssoc').val(counterAssoc);
534
 
600
 
535
         }
601
         }
536
 
602
 
537
         function addAssoc() {
603
         function addAssoc() {
538
 
604
 
539
-
605
+            counterAssoc += 1;
540
             var $select = $('<select />', {
606
             var $select = $('<select />', {
541
-                'class': "selectpicker form-control",
607
+                'class': "selectpicker form-control ",
542
                 'name': "assoc_outcome[]",
608
                 'name': "assoc_outcome[]",
543
                 'data-live-search': 'true',
609
                 'data-live-search': 'true',
544
                 'id': 'assoc_outcome' + counterAssoc.toString(),
610
                 'id': 'assoc_outcome' + counterAssoc.toString(),
611
+                'data-new-outcome': 'true'
545
 
612
 
546
             });
613
             });
547
             var $div = $('<div />', {
614
             var $div = $('<div />', {
548
                 'id': 'assocOutcomeForm' + counterAssoc.toString(),
615
                 'id': 'assocOutcomeForm' + counterAssoc.toString(),
549
-                'class': 'form-group col-md-11'
616
+                'class': 'form-group col-md-11 removable-outcome'
550
             });
617
             });
551
             var $divForButton = $('<div />', {
618
             var $divForButton = $('<div />', {
552
-                'class': 'col-md-1',
619
+                'class': 'col-md-1 removable-outcome',
553
                 'id': 'closeAssoc' + counterAssoc.toString()
620
                 'id': 'closeAssoc' + counterAssoc.toString()
554
 
621
 
555
             });
622
             });
556
             var $button = $('<button />', {
623
             var $button = $('<button />', {
557
                 'type': 'button',
624
                 'type': 'button',
558
                 'class': 'btn btn-primary',
625
                 'class': 'btn btn-primary',
559
-                'onclick': 'deleteLastAssoc()'
626
+                'onclick': 'deleteLastAssoc(' + counterAssoc + ')'
560
             });
627
             });
561
             $button.append('X');
628
             $button.append('X');
562
             $divForButton.append($button);
629
             $divForButton.append($button);
569
 
636
 
570
 
637
 
571
             ran = true;
638
             ran = true;
572
-            counterAssoc += 1;
639
+            //counterAssoc += 1;
573
             $('#counterAssoc').val(counterAssoc);
640
             $('#counterAssoc').val(counterAssoc);
574
 
641
 
575
 
642
 
576
 
643
 
577
         }
644
         }
645
+
646
+        $("#update_button_to_modal").on('click', function(e) {
647
+            e.preventDefault();
648
+            newOutcomes = [];
649
+            $('#assocOutcomeGroup').find('select').each(function() {
650
+                if ($(this).data('new-outcome') == true) {
651
+                    option = $(this).find(':selected');
652
+                    newOutcomes.push(option[0].text);
653
+                }
654
+            })
655
+
656
+            if (newOutcomes.length > 0) {
657
+                ul = $("<ul>");
658
+
659
+                $.each(newOutcomes, function(id, text) {
660
+                    li = $("<li>").html(text)
661
+                    ul.append(li);
662
+                });
663
+
664
+                $("#ObjectiveModalBody").html(ul);
665
+                $('#ObjectiveAssocModal').modal("toggle");
666
+            } else {
667
+                pair_every_criteria_with_objective = 0;
668
+                $("#update_button").click();
669
+
670
+            }
671
+
672
+
673
+        })
674
+        //Terrible notation but
675
+
676
+        pair_every_criteria_with_objective = 0;
578
         $('#update_button').on('click', function(e) {
677
         $('#update_button').on('click', function(e) {
579
             e.preventDefault();
678
             e.preventDefault();
580
 
679
 
581
             outcome_id = []
680
             outcome_id = []
582
             program_id = [];
681
             program_id = [];
583
-            
682
+
584
             status = $('#status').val();
683
             status = $('#status').val();
585
             text = $('#objective-text').val();
684
             text = $('#objective-text').val();
586
             id = $('#select-objective').val();
685
             id = $('#select-objective').val();
588
             $('#assocOutcomeGroup').find('select').each(function() {
687
             $('#assocOutcomeGroup').find('select').each(function() {
589
                 outcome_id.push($(this).val())
688
                 outcome_id.push($(this).val())
590
             })
689
             })
591
-$('input[name="assoc_program_id[]"]').each(function() {
690
+            $('input[name="assoc_program_id[]"]').each(function() {
592
                 if (this.checked)
691
                 if (this.checked)
593
                     program_id.push($(this).val())
692
                     program_id.push($(this).val())
594
             });
693
             });
598
                     program_id: program_id,
697
                     program_id: program_id,
599
                     status: status,
698
                     status: status,
600
                     text: text,
699
                     text: text,
601
-                    id: id
700
+                    id: id,
701
+                    pair_every_criteria_with_objective: pair_every_criteria_with_objective
602
                 },
702
                 },
603
                 function($array) {
703
                 function($array) {
604
                     div = $('<div/>', {
704
                     div = $('<div/>', {
642
 
742
 
643
     $('#outcome-display').parent().hide();
743
     $('#outcome-display').parent().hide();
644
 
744
 
645
-    fetchObjectiveForEditing();
745
+    // fetchObjectiveForEditing();
646
     // setCriterionStatus();
746
     // setCriterionStatus();
647
 
747
 
648
 
748