Browse Source

ando cansado y pico

desde las doce pm algarete
parent
commit
e05ba8b638

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

@@ -705,9 +705,13 @@ class AnnualPlansController extends \BaseController
705 705
       ->first();
706 706
     $outcome->transforming_actions = DB::table('transformative_typ_outcome')
707 707
       ->join('transformative_actions', 'transformative_actions.id', '=', 'transformative_typ_outcome.trans_id')
708
+      ->leftJoin('transformative_action_status', 'transformative_actions.id', '=', 'transformative_action_status.trans_id')
708 709
       ->where('typ_semester_outcome_id', $typ_semester_outcome_id)
709
-      ->select('transformative_actions.*')
710
+      ->select('transformative_actions.*', 'transformative_action_status.*', 'transformative_actions.id as trans_id')
710 711
       ->get();
712
+    $outcome->semester_info = DB::table('semesters')
713
+      ->where('id', $semester_id)
714
+      ->first();
711 715
 
712 716
     foreach ($outcome->objectives as $index => $objective) {
713 717
       $objective->courses = Objective::getPlanReport($objective);

+ 2
- 2
app/controllers/OutcomesController.php View File

@@ -1068,8 +1068,8 @@ class OutcomesController extends \BaseController
1068 1068
         from annual_plans 
1069 1069
         join annual_cycle on annual_cycle_id = annual_cycle.id 
1070 1070
         where program_id = {$program_id} 
1071
-        and
1072
-        annual_plans.is_submitted =1
1071
+        
1072
+        
1073 1073
           order by semester_start desc");
1074 1074
         $program = DB::table('programs')
1075 1075
             ->where('id', $program_id)

+ 52
- 0
app/controllers/TransformativeActionsController.php View File

@@ -1460,4 +1460,56 @@ class TransformativeActionsController extends \BaseController
1460 1460
       ->delete();
1461 1461
     return;
1462 1462
   }
1463
+
1464
+  public function fetchStatus()
1465
+  {
1466
+    $trans_id = Input::get('trans_id');
1467
+    $semester_id = Input::get('semester_id');
1468
+    $transformative_action = DB::table('transformative_actions')
1469
+      ->where('id', $trans_id)
1470
+      ->first();
1471
+    $transformative_action->status = DB::table('transformative_action_status')
1472
+      ->where('trans_id', $transformative_action->id)
1473
+      ->where('semester_id', $semester_id)
1474
+      ->first();
1475
+
1476
+
1477
+    //TransformativeAction::find($trans_id)->status($semester_id);
1478
+
1479
+    return array($transformative_action);
1480
+  }
1481
+  public function saveTransStatus()
1482
+  {
1483
+    $semester_id = Input::get('semester_id');
1484
+    $trans_id = Input::get('trans_id');
1485
+    $results = Input::get('results');
1486
+    $comments = Input::get('comments');
1487
+    $accomplished = Input::get('accomplished');
1488
+    $was_it_useful = Input::get('was_it_useful');
1489
+
1490
+    $existing_status = DB::table('transformative_action_status')
1491
+      ->where('semester_id', $semester_id)
1492
+      ->where('trans_id', $trans_id)
1493
+      ->first();
1494
+    if ($existing_status) {
1495
+      DB::table('transformative_action_status')->update(array(
1496
+        'results' => $results,
1497
+        'comments' => $comments,
1498
+        'accomplished' => $accomplished,
1499
+        'it_was_useful' => $was_it_useful,
1500
+        'supervised_coordinator_id' => Auth::user()->id
1501
+      ));
1502
+    } else {
1503
+      DB::table('transformative_action_status')->insert(array(
1504
+        'trans_id' => $trans_id,
1505
+        'results' => $results,
1506
+        'comments' => $comments,
1507
+        'accomplished' => $accomplished,
1508
+        'it_was_useful' => $was_it_useful,
1509
+        'semester_id' => $semester_id,
1510
+        'supervised_coordinator_id' => Auth::user()->id
1511
+      ));
1512
+    }
1513
+    return "done";
1514
+  }
1463 1515
 }

+ 9
- 5
app/database/migrations/2022_02_13_122842_add_results_to_transformative_status.php View File

@@ -3,7 +3,8 @@
3 3
 use Illuminate\Database\Schema\Blueprint;
4 4
 use Illuminate\Database\Migrations\Migration;
5 5
 
6
-class AddResultsToTransformativeStatus extends Migration {
6
+class AddResultsToTransformativeStatus extends Migration
7
+{
7 8
 
8 9
 	/**
9 10
 	 * Run the migrations.
@@ -12,7 +13,9 @@ class AddResultsToTransformativeStatus extends Migration {
12 13
 	 */
13 14
 	public function up()
14 15
 	{
15
-		//
16
+		Schema::table('transformative_action_status', function (Blueprint $table) {
17
+			$table->text('results')->nullable();
18
+		});
16 19
 	}
17 20
 
18 21
 	/**
@@ -22,7 +25,8 @@ class AddResultsToTransformativeStatus extends Migration {
22 25
 	 */
23 26
 	public function down()
24 27
 	{
25
-		//
28
+		Schema::table('transformative_action_status', function (Blueprint $table) {
29
+			$table->dropColumn('results');
30
+		});
26 31
 	}
27
-
28
-}
32
+}

+ 39
- 0
app/database/migrations/2022_02_15_121554_create_transformative_future_course.php View File

@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+use Illuminate\Database\Schema\Blueprint;
4
+use Illuminate\Database\Migrations\Migration;
5
+
6
+class CreateTransformativeFutureCourse extends Migration
7
+{
8
+
9
+	/**
10
+	 * Run the migrations.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function up()
15
+	{
16
+		Schema::create('transformative_future_course', function (Blueprint $table) {
17
+			$table->increments('id');
18
+			$table->integer('trans_id')->unsigned();
19
+			$table->char('course_code', 8);
20
+			$table->char('course_number', 4)->default('0000');
21
+			$table->integer('semester_id')->unsigned();
22
+			$table->foreign('trans_id')
23
+				->references('id')
24
+				->on('transformative_actions')
25
+				->onDelete('cascade')
26
+				->onUpdate('cascade');
27
+		});
28
+	}
29
+
30
+	/**
31
+	 * Reverse the migrations.
32
+	 *
33
+	 * @return void
34
+	 */
35
+	public function down()
36
+	{
37
+		Schema::drop('transformative_future_course');
38
+	}
39
+}

+ 38
- 0
app/database/migrations/2022_02_15_131614_add_user_id_to_template.php View File

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

+ 37
- 0
app/database/migrations/2022_02_15_184454_add_semester_id_transformative_action_status.php View File

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

+ 4
- 1
app/models/Activity.php View File

@@ -393,7 +393,10 @@ class Activity extends Eloquent
393 393
     $outcomes_attempted = [];
394 394
 
395 395
     $all_criterion = DB::table('activity_criterion')
396
+      ->join('assessments', 'assessments.activity_criterion_id', '=', 'activity_criterion.id')
396 397
       ->where('activity_criterion.activity_id', '=', $this->id)
398
+      ->groupBy('criterion_id')
399
+
397 400
       ->lists('criterion_id');
398 401
 
399 402
     foreach ($all_criterion as $index => $criterion_id) {
@@ -414,4 +417,4 @@ class Activity extends Eloquent
414 417
     //return json_decode($this->outcomes_attempted, true);
415 418
     return $outcomes_attempted;
416 419
   }
417
-}
420
+}

+ 1
- 1
app/models/Course.php View File

@@ -181,7 +181,7 @@ class Course extends Eloquent
181 181
   public static function getStudentReportForOutcome($course_code = null)
182 182
   {
183 183
     if ($course_code) {
184
-      Log::info('entré');
184
+      //Log::info('entré');
185 185
       $criteria_id = DB::table('annual_plan_objective')
186 186
         ->where('typ_semester_course_id', $course_code->typ_semester_course_id)
187 187
         ->lists('criteria_id');

+ 9
- 1
app/models/TransformativeAction.php View File

@@ -3,4 +3,12 @@
3 3
 class TransformativeAction extends Eloquent
4 4
 {
5 5
     protected $table = 'transformative_actions';
6
-}
6
+
7
+    public function scopeStatus($query, $semester_id)
8
+    {
9
+        return $query->join('transformative_action_status')
10
+            ->where('trans_id', $this->id)
11
+            ->where('semester_id', $semester_id)
12
+            ->first();
13
+    }
14
+}

+ 11
- 0
app/models/TransformativeActionStatus.php View File

@@ -0,0 +1,11 @@
1
+<?php
2
+
3
+class TransformativeActionStatus extends Eloquent
4
+{
5
+    protected $table = 'transformative_action_status';
6
+
7
+    public function trans_id()
8
+    {
9
+        return $this->belongsTo('TransformativeAction');
10
+    }
11
+}

+ 2
- 0
app/routes.php View File

@@ -204,7 +204,9 @@ Route::group(array('before' => 'auth|has_access'), function () {
204 204
 
205 205
     Route::post('submitAnnualPlan', array('uses' => 'AnnualPlansController@submitAnnualPlan'));
206 206
 
207
+    Route::post('fetchTransformativeStatus', array('uses' => 'TransformativeActionsController@fetchStatus'));
207 208
 
209
+    Route::post('saveTransStatus', array('uses' => 'TransformativeActionsController@saveTransStatus'));
208 210
     //other stuff
209 211
     Route::post('postActivityCriterionTrans/{activity_id}', array(
210 212
         'as' => 'postActivityCriterionTrans/{activity_id}',

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

@@ -212,7 +212,7 @@
212 212
 
213 213
                             {{ Form::label('program_id2', 'Associated Program') }}<br><br>
214 214
 
215
-                            <input type=" hidden" id="{{ $programs[0]->name }}" name="program_id[]"
215
+                            <input type="hidden" id="{{ $programs[0]->name }}" name="program_id[]"
216 216
                         value="{{ $programs[0]->id }}">
217 217
 
218 218
                         <input type="checkbox" id="assoc_program_id_{{ $programs[0]->id }}" name="program_id[]"

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

@@ -52,11 +52,18 @@
52 52
                     </div>
53 53
 
54 54
                     <ul id="levelTabs" class="nav nav-tabs" role="tablist">
55
-
55
+                        <li role = "presentation" id = 'transformative_for_outcome'>
56
+                            <a data-toggle="tab" id="a_for_ta_outcome" href="#transformative_actions" role="tab" aria-expanded="true">Transformative Actions</a>
57
+                        </li>
56 58
                     </ul>
57 59
                     <div id="allLists" class="tab-content">
60
+                        <div role="tabpanel" class="tab-pane active" id="transformative_actions">
58 61
 
62
+                        </div>
59 63
                     </div>
64
+                    
65
+
66
+                    
60 67
                     <!-- <div class="table-responsive">
61 68
                         <table class="table table-striped table-condensed datatable" style="table-layout: fixed ; width : 100%">
62 69
                           <thead><tr><th>Objectives for courses</th><th>Criteria per Course</th><th>Transformative Actions</th></tr></thead>
@@ -79,6 +86,44 @@
79 86
         </div>
80 87
 
81 88
     </div>
89
+    <div class="modal fade" id="modal-status-trans">
90
+        <div class="modal-dialog modal-lg">
91
+            <div class="modal-content">
92
+                <div class="modal-header">
93
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
94
+                            aria-hidden="true">&times;</span></button>
95
+                    <h3 class="modal-title"></h3>
96
+                </div>
97
+                <div class="modal-body">
98
+                   <h5 id="was_it_implemented"> </h5>
99
+              <label class="radio-inline">
100
+                  <input type="radio"  name="implemented" value = "1">Yes</label>
101
+              <label class="radio-inline">
102
+                  <input type="radio" name="implemented" value = "0">No</label>
103
+                  <br>
104
+                <div id='useful_radio_div'>
105
+                    <h5>Was this transformative action helpful to achieve the learning expectation?</h5>
106
+                <label class="radio-inline">
107
+                    <input type="radio"  name="useful" value = "1">Yes</label>
108
+                <label class="radio-inline">
109
+                    <input type="radio" name="useful" value = "0">No</label>
110
+                </div>
111
+                <br>
112
+        <div id='comment_div'>
113
+            <label id="implement_textarea" for='comments'></label>
114
+            <textarea  class="form-control" id='comments'>
115
+            </textarea>
116
+        </div>
117
+            
118
+   
119
+              
120
+            </div>
121
+            <div class='modal-footer'>
122
+                <button type="button" class="btn btn-secondary" data-dismiss="modal" >Cancel</button>
123
+                <button type="button" class="btn btn-primary" id ="save_transformative_info" onclick ='saveTransReport()'>Save</button>
124
+            </div><!-- /.modal-content -->
125
+        </div><!-- /.modal-dialog -->
126
+    </div><!-- /.modal -->
82 127
     <script>
83 128
         function nextChar(c) {
84 129
             return String.fromCharCode(c.charCodeAt(0) + 1);
@@ -89,7 +134,22 @@
89 134
             // --------------------------------------------------------------------------
90 135
             // Page load
91 136
             // --------------------------------------------------------------------------
92
-
137
+            $('#comment_div').hide();
138
+            $('input[name="implemented"]').change(function(){
139
+                //was implemented
140
+                if(!parseInt($(this).val())){
141
+                    $('#useful_radio_div').hide();
142
+                    $('#comment_div').show();
143
+                    $('#comments').val(' ');
144
+                    $('#implement_textarea').html("Explain briefly why this transformative action was not implemented");
145
+                    }
146
+                else{
147
+                    $('#useful_radio_div').show();
148
+                    $('#comment_div').show();
149
+                    $('#implement_textarea').html("Explain briefly details about the implementation of this transformative action");
150
+                   
151
+                }
152
+            })
93 153
             // Hide accordion panel contents by default
94 154
             $('.panel-group .panel-body').hide();
95 155
 
@@ -109,6 +169,67 @@
109 169
 
110 170
         // Create everything 
111 171
 
172
+        function  draw_transformative_actions(transforming_actions, semester_id){
173
+            if(!transforming_actions.length){
174
+                $("#transformative_for_outcome").hide();
175
+            }
176
+            else{
177
+                $('#levelTabs').prepend('<li role = "presentation" id = "transformative_for_outcome">'+
178
+                            '<a data-toggle="tab" id="a_for_ta_outcome" href="#transformative_actions" role="tab" >Transformative Actions</a>'+
179
+                            '</li>');
180
+                $('#allLists').prepend('<div role="tabpanel" class="tab-pane" id="transformative_actions"></div>');
181
+                        
182
+                $('#transformative_actions').html('<h3>Tranformative actions for Learning Outcome')
183
+                $.each(transforming_actions, function(index, trans_action){
184
+                    div = $("<div>", {
185
+                        'id':'div_trans_id_'+trans_action.trans_id
186
+                    }).html('<p><strong>'+(index+1)+'. '+trans_action.at_text+': </strong>'+trans_action.description+'</p>'+
187
+                    '<p><strong>Category: </strong> '+trans_action.type_of_TA+'</p>');
188
+                    div.append('<label>Results: </label>')
189
+                    input_results = $("<textarea>", {
190
+                        'class':'form-control',
191
+                        'id':'results_for_'+trans_action.trans_id
192
+                    });
193
+                    div.append(input_results)
194
+
195
+                    div.append('<h5>Was this transformative action helpful to achieve the learning expectation?</h5>'+
196
+                    '<label class="radio-inline">'+
197
+                    '<input type="radio"  name="useful_for_'+trans_action.trans_id+'" value = "1">Yes</label>'+
198
+                    '<label class="radio-inline">'+
199
+                    '<input type="radio" name="useful_for_'+trans_action.trans_id+'" value = "0">No</label>');
200
+                    comments = $('<textarea>',{
201
+                        'id':'comments_for_'+trans_action.trans_id,
202
+                        'class':'form-control'
203
+                    });
204
+                    div.append('<br><label>Explain briefly details about the implementation</label>');
205
+                    div.append(comments);
206
+                    
207
+                    button = $('<button>',{
208
+                        "type":"button",
209
+                        "class":"btn btn-primary",
210
+                        "onclick":'saveTransReport('+trans_action.trans_id+', '+semester_id+')',
211
+                        'style':'float: right'
212
+          
213
+                    }).html('Save');
214
+                    div.append('<br>');
215
+                    div.append(button);
216
+                    div.append('<br>');
217
+                    div.append('<hr>');
218
+
219
+                    $('#transformative_actions').append(div);
220
+
221
+                    $('#results_for_'+trans_action.trans_id).val(trans_action.results);
222
+                    $('#comments_for_'+trans_action.trans_id).val(trans_action.comments);
223
+                    $('input[name="useful_for_'+trans_action.trans_id+'"][value="'+trans_action.it_was_useful + '"]').prop('checked', true);
224
+
225
+                
226
+
227
+
228
+
229
+                })
230
+            }
231
+        }
232
+
112 233
         function fetchEverything(li) {
113 234
             var outcome_id = $(li).data('outcome-id');
114 235
             var name = $(li).data('outcome-name');
@@ -164,13 +285,16 @@
164 285
                             '<th>Percentage</th>' +
165 286
                             '<th>Outcome Achieved</th>' +
166 287
                             '</tr></thead><tbody></tbody>');
288
+                        first_objective_id = outcome.objectives[0].id;
167 289
                         $.each(outcome.objectives, function(index, objective) {
168 290
 
169 291
                             li = $('<li/>', {
170
-                                'role': 'presentation'
292
+                                'role': 'presentation',
293
+                                'id':'li_for_'+objective.id
171 294
                             });
172 295
                             a = $('<a/>', {
173 296
                                 'data-toggle': 'tab',
297
+                                'id': 'a_for_'+objective.id,
174 298
                                 'href': '#' + objective.id,
175 299
                                 'role': 'tab'
176 300
                             }).html('Objective ' + (index + 1));
@@ -188,6 +312,12 @@
188 312
 
189 313
                             div.appendTo($('#allLists'))
190 314
 
315
+                            div.append(
316
+                                            '<p>The following results are from the courses in the selected semester with the focused criteria in the selected annual plan</p>'
317
+                                        );
318
+
319
+                            
320
+
191 321
 
192 322
                             if (objective.courses) {
193 323
                                 $.each(objective.courses, function(index, course_code) {
@@ -212,9 +342,9 @@
212 342
                                                 .criteria_achieved;
213 343
 
214 344
                                         });
215
-                                        div.append(
345
+                                        /*div.append(
216 346
                                             '<p>The following results are from the courses in the selected semester with the focused criteria in the selected annual plan</p>'
217
-                                        );
347
+                                        );*/
218 348
                                         table = $('<table/>', {
219 349
                                             'class': 'table table-striped table-condensed datatable'
220 350
                                         }).html('<thead><th>Criterion</th><th>' +
@@ -234,27 +364,50 @@
234 364
                                             tbody.append(tr);
235 365
                                         });
236 366
                                         table.append(tbody);
237
-                                        Course_and_transformative = '<h3>' + course_code.code + ' ' +
367
+                                        Course_section = '<h3>' + course_code.code + ' ' +
238 368
                                             course_code.number + '</h3><hr>';
369
+                                            
370
+                                        div.append(Course_section)
371
+                                        div.append('<h4> Criteria Assessed in '+course_code.code+' '+course_code.number+'</h4>')
372
+                                        div.append(table);
239 373
                                         if (course_code.transforming_actions.length) {
240
-                                            Course_and_transformative +=
241
-                                                '<h5> This course was tied to the following transformative actions</h5>';
242
-                                            Course_and_transformative += '<ol>';
374
+                                             table_for_transformative_actions = $('<table>',{
375
+                                                'class': 'table table-striped table-condensed datatable'
376
+                                             }).html('<thead><th>Transformative Actions Proposed in Annual Plan</th>' +
377
+                                            '<th>Follow up </th>' +
378
+                                            '</thead>'
379
+                                        );
380
+                                        tbody_for_transformative_actions = $('<tbody>');
381
+                                            
243 382
                                             $.each(course_code.transforming_actions, function(index,
244 383
                                                 transformative_action) {
245
-                                                Course_and_transformative += '<li><p><strong>' +
246
-                                                    transformative_action.at_text +
247
-                                                    '</strong>: ' + transformative_action
248
-                                                    .description + '</p></li>'
384
+
385
+                                                button_for_followup = $('<button>',{
386
+                                                    'class':'btn btn-secondary',
387
+                                                    'onclick':'give_follow_up_questions('+transformative_action.id+', "'+outcome.semester_info.code+'", '+outcome.semester_info.id+')'
388
+                                                }).html('Follow Up Questions');
389
+                                                table_row = "<tr>"+
390
+                                                '<td><p><strong>'+transformative_action.at_text +': </strong>'+
391
+                                                transformative_action.description+'</p></td>'+
392
+                                                '<td>'+button_for_followup.prop('outerHTML')+'</td></tr>';
393
+
394
+                                                tbody_for_transformative_actions.append(table_row)
395
+                                                
396
+                                                
249 397
                                             })
398
+                                            table_for_transformative_actions.append(tbody_for_transformative_actions);
399
+                                            div.append('<hr><h4>Transformative actions for '+course_code.code+' '+course_code.number+'</h4>')
400
+                                            div.append(table_for_transformative_actions);
401
+                                            //table_for_transformative_actions.DataTable();
250 402
                                         }
251 403
 
252
-                                        div.append(Course_and_transformative)
253
-                                        div.append(table);
404
+                                        
254 405
                                         table.DataTable();
255 406
 
256 407
 
257 408
                                     }
409
+    
410
+                                    
258 411
 
259 412
 
260 413
                                 })
@@ -270,6 +423,9 @@
270 423
 
271 424
 
272 425
                         })
426
+
427
+                        draw_transformative_actions(outcome.transforming_actions, outcome.semester_info.id)
428
+                        //$('#a_for_'+first_objective_id).click();
273 429
                         theArray = [];
274 430
 
275 431
                         $('#tableOutcome').html(tableStudent);
@@ -328,6 +484,10 @@
328 484
 
329 485
 
330 486
 
487
+
488
+
489
+
490
+
331 491
                         /* table.row.add([
332 492
                               objectivesHTML,
333 493
                               courseshtml,
@@ -355,6 +515,87 @@
355 515
 
356 516
         }
357 517
 
518
+        function give_follow_up_questions(trans_id, semester_code, semester_id){
519
+        
520
+
521
+            $.ajax({
522
+                type: 'POST',
523
+                url: "{{ URL::action('TransformativeActionsController@fetchStatus') }}",
524
+                data: {
525
+                    trans_id:trans_id,
526
+                    semester_id:semester_id
527
+                },
528
+                success: function(transformative_action_with_status) {
529
+                    transformative_action = transformative_action_with_status[0];
530
+
531
+                    $('.modal-title').html('<strong>'+transformative_action.at_text+'</strong>: '+transformative_action.description);
532
+                    
533
+                   
534
+                    $('input[name="implemented"]').prop('checked',false);
535
+                    $('input[name="useful"]').prop('checked',false);
536
+                    $('#comments').val(' ');
537
+                    $('#useful_radio_div').hide();
538
+                    $('#comment_div').hide();
539
+                    
540
+                    if(transformative_action['status']){
541
+                        transformative_action['status'].accomplished;
542
+                        $('input[name="implemented"][value="'+ transformative_action['status'].accomplished + '"]').prop('checked', true);
543
+                        if(transformative_action['status'].accomplished){
544
+                        $('#useful_radio_div').show();
545
+                        $('input[name="useful"][value="'+ transformative_action['status'].it_was_useful + '"]').prop('checked', true);
546
+                        }
547
+                        $('#comment_div').show();
548
+                        $('#comments').val(transformative_action['status'].comments);
549
+                        
550
+                    }
551
+
552
+                    $('#was_it_implemented').html('Was this transformative action implemented during Semester '+semester_code);
553
+
554
+
555
+
556
+                    $('#modal-status-trans').modal();
557
+                    $('#save_transformative_info').attr('onclick', 'saveTransReport('+trans_id+','+semester_id+',"modal")');
558
+
559
+                },
560
+                async: true
561
+            });
562
+
563
+        }
564
+
565
+        function saveTransReport(trans_id, semester_id, type_of_input){
566
+            if(type_of_input=='modal'){
567
+                comments = $('#comments').val();
568
+                accomplished = parseInt($('input[name="implemented"]:checked').val());
569
+                if(accomplished)
570
+                was_it_useful = $('input[name="useful"]:checked').val();
571
+                else was_it_useful =0;
572
+                results = "";
573
+            }
574
+            else{
575
+                comments = $('#comments_for_'+trans_id).val();
576
+                accomplished = 1;
577
+                was_it_useful = $('input[name="useful_for_'+trans_id+'"]:checked').val();
578
+                results = $('#results_for_'+trans_id).val();
579
+            }
580
+
581
+            $.post(
582
+                "{{URL::action('TransformativeActionsController@saveTransStatus')}}",
583
+                {
584
+                    semester_id:semester_id,
585
+                    trans_id:trans_id,
586
+                    results:results,
587
+                    comments:comments,
588
+                    accomplished:accomplished,
589
+                    was_it_useful:was_it_useful,
590
+                },
591
+                function(message){
592
+                    alert(message);
593
+                }
594
+            )
595
+        }
596
+
597
+
598
+
358 599
         function posttoTransAnnual(annual_id, selectTransId, typ_course_id) {
359 600
             ta = $("#" + selectTransId).val();
360 601
             old_ta = $("#" + selectTransId).data('old-TA');

+ 1
- 0
app/views/local/professors/course.blade.php View File

@@ -89,6 +89,7 @@
89 89
                         <td>{{ date('M d, Y', strtotime($activity->updated_at)) }}</td>
90 90
                         <td>
91 91
                             @if($activity->o_att_array)
92
+                            <?php Log::info($activity->id);?>
92 93
                                 <span class="glyphicon glyphicon-ok"></span>
93 94
                             @endif
94 95
                         </td>