Browse Source

Fixes for Transformative Action page

-Deleted code that was commented.
-Change the order of function definition in the controller.
-Fixed the use of clean input and validator in the controller.
onielm 3 years ago
parent
commit
ce35d2425d

+ 476
- 564
app/controllers/TransformativeActionsController.php
File diff suppressed because it is too large
View File


+ 9
- 19
app/views/local/managers/admins/transformativeAction.blade.php View File

22
               {{ Form::open(array('action' => 'TransformativeActionsController@createTA')) }}
22
               {{ Form::open(array('action' => 'TransformativeActionsController@createTA')) }}
23
 
23
 
24
               <div class="form-group">
24
               <div class="form-group">
25
-                {{ Form::label('createText', 'Name') }}
26
-                {{ Form::text('createText', '', array('class' => 'form-control')) }}
25
+                {{ Form::label('text', 'Name') }}
26
+                {{ Form::text('text', '', array('class' => 'form-control')) }}
27
               </div>
27
               </div>
28
 
28
 
29
               <div class="form-group">
29
               <div class="form-group">
30
-                {{ Form::label('createDescription', 'Description') }}
31
-                {{ Form::textarea('createDescription', '', array('class' => 'form-control')) }}
30
+                {{ Form::label('description', 'Description') }}
31
+                {{ Form::textarea('description', '', array('class' => 'form-control')) }}
32
               </div>
32
               </div>
33
 
33
 
34
               <div class="form-group"> </div>
34
               <div class="form-group"> </div>
72
               <label>Associated Objectives</label>
72
               <label>Associated Objectives</label>
73
               <div class="" id="">
73
               <div class="" id="">
74
                 <div class="form-group col-md-11">
74
                 <div class="form-group col-md-11">
75
-                  {{-- <select class="form-control selectpicker"> --}}
76
                   <select name="objectiveid[]" class="form-control createObjectives">
75
                   <select name="objectiveid[]" class="form-control createObjectives">
77
-                    {{-- @foreach ($objectives as $id => $text)
78
-                      <option value="{{$id}}">{{$text}}</option>
79
-                    @endforeach --}}
80
                     <option value="">First, select an Outcome</option>
76
                     <option value="">First, select an Outcome</option>
81
                   </select>
77
                   </select>
82
-                  {{-- {{ Form::select('objective[]', $objectives, reset($objectives),  ['class'=>'form-control selectpicker', 'id' =>'objective0']) }} --}}
83
                 </div>
78
                 </div>
84
                 <button type="button" class='btn btn-md btn-primary col-md-1 remove-objective'>
79
                 <button type="button" class='btn btn-md btn-primary col-md-1 remove-objective'>
85
                   X
80
                   X
86
                 </button>
81
                 </button>
87
               </div>
82
               </div>
88
               <button type="button" class='btn btn-md btn-secondary add-objective'>
83
               <button type="button" class='btn btn-md btn-secondary add-objective'>
89
-              {{-- <button type="button" class='btn btn-md btn-secondary add-create-objective'> --}}
90
                 <span class='glyphicon glyphicon-plus'>
84
                 <span class='glyphicon glyphicon-plus'>
91
                 </span>
85
                 </span>
92
                 Add another Objective
86
                 Add another Objective
154
                     @if (count($ta_approval_panel) == 0)
148
                     @if (count($ta_approval_panel) == 0)
155
                       <option value="0">No TAs available</option>
149
                       <option value="0">No TAs available</option>
156
                     @else
150
                     @else
157
-                      {{-- <option value="0">Select a TA</option> --}}
158
                     @endif
151
                     @endif
159
                     @foreach ($ta_approval_panel as $ta)
152
                     @foreach ($ta_approval_panel as $ta)
160
                       <option value="{{$ta->id}}">{{$ta->at_text}}</option>
153
                       <option value="{{$ta->id}}">{{$ta->at_text}}</option>
161
-                     {{-- <option value="{{$ta->id}}">{{$ta->at_text}}</option> --}}
162
                    @endforeach
154
                    @endforeach
163
                   </select>
155
                   </select>
164
                 </div>
156
                 </div>
274
                      @if (count($ta_edit_panel) == 0)
266
                      @if (count($ta_edit_panel) == 0)
275
                        <option value="0">No TAs available</option>
267
                        <option value="0">No TAs available</option>
276
                      @else
268
                      @else
277
-                       {{-- <option value="0">Select a TA</option> --}}
278
                      @endif
269
                      @endif
279
                      @foreach ($ta_edit_panel as $ta)
270
                      @foreach ($ta_edit_panel as $ta)
280
                       <option value="{{$ta->id}}">{{$ta->at_text}}</option>
271
                       <option value="{{$ta->id}}">{{$ta->at_text}}</option>
284
               </div>
275
               </div>
285
 
276
 
286
               <div class="form-group" id="editName">
277
               <div class="form-group" id="editName">
287
-                {{ Form::label('editText', 'Name') }}
288
-                {{ Form::text('editText', '', array('class' => 'form-control')) }}
278
+                {{ Form::label('text', 'Name') }}
279
+                {{ Form::text('text', '', array('class' => 'form-control')) }}
289
               </div>
280
               </div>
290
               <input type='hidden' name='ta_id' class='updateTA' value="0">
281
               <input type='hidden' name='ta_id' class='updateTA' value="0">
291
 
282
 
292
               <div class="form-group">
283
               <div class="form-group">
293
-                {{ Form::label('editDescription', 'Description') }}
294
-                {{ Form::textarea('editDescription', '', array('class' => 'form-control')) }}
284
+                {{ Form::label('description', 'Description') }}
285
+                {{ Form::textarea('description', '', array('class' => 'form-control')) }}
295
               </div>
286
               </div>
296
 
287
 
297
               <div class="form-group"> </div>
288
               <div class="form-group"> </div>
332
                       <option value="{{$id}}">{{$text}}</option>
323
                       <option value="{{$id}}">{{$text}}</option>
333
                     @endforeach
324
                     @endforeach
334
                   </select>
325
                   </select>
335
-                  {{-- {{ Form::select('objective[]', $objectives, reset($objectives),  ['class'=>'form-control selectpicker', 'id' =>'objective0']) }} --}}
336
                 </div>
326
                 </div>
337
                 <button type="button" class='btn btn-md btn-primary col-md-1 remove-objective'>
327
                 <button type="button" class='btn btn-md btn-primary col-md-1 remove-objective'>
338
                   X
328
                   X
572
 
562
 
573
       //set the text box
563
       //set the text box
574
       $('#editName').find('input').val(name);
564
       $('#editName').find('input').val(name);
575
-      $('#editDescription').val(description);
565
+      $('#editPanel #description').val(description);
576
 
566
 
577
       //
567
       //
578
       $('#deleteTA').val(ta_id);
568
       $('#deleteTA').val(ta_id);