Browse Source

Merge branch 'debugging_log' into Merge_gabriel_mayo

eduardo-santin 3 years ago
parent
commit
880bb4dfd1

+ 31
- 32
app/views/local/managers/admins/objectives.blade.php View File

71
                     <span class="glyphicon glyphicon-plus">
71
                     <span class="glyphicon glyphicon-plus">
72
                     </span>
72
                     </span>
73
                     Filters
73
                     Filters
74
-                  </button>
75
-                  <div class='filterSection'>
76
-                {{ Form::open(array('action' => 'Objective2Controller@update')) }}
77
-                <div class="form-group">
78
-                    {{ Form::label('program_id2', 'Associated Program')}}
79
-                    <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
80
-                        @foreach ($programs as $program)
81
-                        <option value='{{$program->id}}' data-subtext="{{$program->code}}">{{$program->name}}</option>
82
-                        @endforeach
83
-                    </select>
84
-                </div>
85
-                <div class="form-group">
86
-                    <label>Associated Outcome</label>
87
-                    {{ Form::select('assoc_outcomes_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
74
+                </button>
75
+                <div class='filterSection'>
76
+                    {{ Form::open(array('action' => 'Objective2Controller@update')) }}
77
+                    <div class="form-group">
78
+                        {{ Form::label('program_id2', 'Associated Program')}}
79
+                        <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
80
+                            @foreach ($programs as $program)
81
+                            <option value='{{$program->id}}' data-subtext="{{$program->code}}">{{$program->name}}</option>
82
+                            @endforeach
83
+                        </select>
84
+                    </div>
85
+                    <div class="form-group">
86
+                        <label>Associated Outcome</label>
87
+                        {{ Form::select('assoc_outcomes_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
88
 
88
 
89
+                    </div>
89
                 </div>
90
                 </div>
90
-                  </div>
91
                 <div class="form-group">
91
                 <div class="form-group">
92
                     {{ Form::label('objective_id', 'Objectives') }}
92
                     {{ Form::label('objective_id', 'Objectives') }}
93
                     <select id="select-objective" name="id" class="form-control selectpicker">
93
                     <select id="select-objective" name="id" class="form-control selectpicker">
116
                         {{ Form::select('outcome[]', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome0']) }}
116
                         {{ Form::select('outcome[]', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome0']) }}
117
 
117
 
118
                     </div>
118
                     </div>
119
-                    
119
+
120
                 </div>
120
                 </div>
121
-                
122
-                
121
+
122
+
123
                 <button id='button-add-assoc-outcome' class='btn btn-md btn-secondary' onclick='addAssoc()'>
123
                 <button id='button-add-assoc-outcome' class='btn btn-md btn-secondary' onclick='addAssoc()'>
124
                     <span class='glyphicon glyphicon-plus'>
124
                     <span class='glyphicon glyphicon-plus'>
125
 
125
 
176
 </div>
176
 </div>
177
 <script>
177
 <script>
178
     $('.filterSection').hide();
178
     $('.filterSection').hide();
179
-    $('.filterButton').on('click', function()
180
-{
181
-  var span = $(this).find('span');
182
-  if(span.attr('class') == 'glyphicon glyphicon-plus'){
183
-    span.attr('class','glyphicon glyphicon-minus');
184
-  } else{
185
-    span.attr('class','glyphicon glyphicon-plus');
186
-  }
187
-  $('.filterSection').toggle(533);
188
-});
179
+    $('.filterButton').on('click', function() {
180
+        var span = $(this).find('span');
181
+        if (span.attr('class') == 'glyphicon glyphicon-plus') {
182
+            span.attr('class', 'glyphicon glyphicon-minus');
183
+        } else {
184
+            span.attr('class', 'glyphicon glyphicon-plus');
185
+        }
186
+        $('.filterSection').toggle(533);
187
+    });
189
     var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
188
     var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
190
     var selectOptions = document.getElementById('outcome[0]').innerHTML;
189
     var selectOptions = document.getElementById('outcome[0]').innerHTML;
191
-   
190
+
192
     function fetchAllObjectives(program, outcome) {
191
     function fetchAllObjectives(program, outcome) {
193
         var program_id_fetch = $('#' + program).find(':selected').val();
192
         var program_id_fetch = $('#' + program).find(':selected').val();
194
         var outcome_fetch = $('#' + outcome).find(':selected').val();
193
         var outcome_fetch = $('#' + outcome).find(':selected').val();
300
 
299
 
301
                 // Select associated outcome
300
                 // Select associated outcome
302
                 for (var i = counterAssoc; i != 1; i--) {
301
                 for (var i = counterAssoc; i != 1; i--) {
303
-                    deleteLastAssoc(i-1);
302
+                    deleteLastAssoc(i - 1);
304
 
303
 
305
                 }
304
                 }
306
                 $('#assoc_outcome0').val(json.outcome[0].outcome_id);
305
                 $('#assoc_outcome0').val(json.outcome[0].outcome_id);
327
                     var $button = $('<button />', {
326
                     var $button = $('<button />', {
328
                         'type': 'button',
327
                         'type': 'button',
329
                         'class': 'btn btn-primary',
328
                         'class': 'btn btn-primary',
330
-                        'onclick': 'deleteLastAssoc('+i+')'
329
+                        'onclick': 'deleteLastAssoc(' + i + ')'
331
                     });
330
                     });
332
                     $button.append('X');
331
                     $button.append('X');
333
                     $divForButton.append($button);
332
                     $divForButton.append($button);
463
         var $button = $('<button />', {
462
         var $button = $('<button />', {
464
             'type': 'button',
463
             'type': 'button',
465
             'class': 'btn btn-primary',
464
             'class': 'btn btn-primary',
466
-            'onclick': 'deleteLastAssoc('+counterAssoc+')'
465
+            'onclick': 'deleteLastAssoc(' + counterAssoc + ')'
467
         });
466
         });
468
         $button.append('X');
467
         $button.append('X');
469
         $divForButton.append($button);
468
         $divForButton.append($button);

+ 331
- 330
app/views/local/managers/pCoords/criteria.blade.php
File diff suppressed because it is too large
View File


+ 40
- 38
app/views/local/managers/pCoords/objectives.blade.php View File

16
                 {{ Form::open(array('action' => 'Objective2Controller@create' )) }}
16
                 {{ Form::open(array('action' => 'Objective2Controller@create' )) }}
17
                 <div id='outcomeGroup'>
17
                 <div id='outcomeGroup'>
18
                     <label> Associated Outcome</label>
18
                     <label> Associated Outcome</label>
19
-                    <div class="form-group col-md-11" id='outcomeForm'>
19
+                    <div class="form-group col-md-11" id='outcomeForm='>
20
 
20
 
21
 
21
 
22
                         {{ Form::select('outcome[0]', $outcomes, null, ['class'=>'form-control selectpicker', 'id' =>'outcome[0]']) }}
22
                         {{ Form::select('outcome[0]', $outcomes, null, ['class'=>'form-control selectpicker', 'id' =>'outcome[0]']) }}
40
                     <br>
40
                     <br>
41
 
41
 
42
 
42
 
43
-                    <input type ="hidden" id='{{ $programs[0]->name }}' name="program_id[]" value="{{$programs[0]->id}}">
43
+                    <input type="hidden" id='{{ $programs[0]->name }}' name="program_id[]" value="{{$programs[0]->id}}">
44
                     <input type="checkbox" id="{{ $programs[0]->name }}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
44
                     <input type="checkbox" id="{{ $programs[0]->name }}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
45
                     <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
45
                     <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
46
 
46
 
65
             <div class="panel-heading">
65
             <div class="panel-heading">
66
                 Edit
66
                 Edit
67
             </div>
67
             </div>
68
-            
68
+
69
 
69
 
70
             <div class="panel-body">
70
             <div class="panel-body">
71
                 <button class="btn btn-md btn-secondary filterButton">
71
                 <button class="btn btn-md btn-secondary filterButton">
72
-                <span class="glyphicon glyphicon-plus">
73
-                </span>
74
-                Filters
75
-              </button>
72
+                    <span class="glyphicon glyphicon-plus">
73
+                    </span>
74
+                    Filters
75
+                </button>
76
                 <div class='filterSection'>
76
                 <div class='filterSection'>
77
-            
77
+
78
                     {{ Form::open(array('action' => 'Objective2Controller@update')) }}
78
                     {{ Form::open(array('action' => 'Objective2Controller@update')) }}
79
-                    
79
+
80
                     <div class="form-group">
80
                     <div class="form-group">
81
                         {{ Form::label('program_id2', 'Associated Program')}}
81
                         {{ Form::label('program_id2', 'Associated Program')}}
82
                         <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
82
                         <select id='select-program' class="form-control selectpicker" onchange='fetchAllObjectives("select-program", "assoc_outcomes_fetch")'>
88
                     <div class="form-group">
88
                     <div class="form-group">
89
                         <label>Associated Outcome</label>
89
                         <label>Associated Outcome</label>
90
                         {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
90
                         {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcomes_fetch', 'onchange'=>'fetchAllObjectives("select-program", "assoc_outcomes_fetch")']) }}
91
-    
91
+
92
                     </div>
92
                     </div>
93
-                      </div>
94
-                      <hr>
93
+                </div>
94
+                <hr>
95
 
95
 
96
                 <div class="form-group">
96
                 <div class="form-group">
97
                     {{ Form::label('objective_id', 'Objectives') }}
97
                     {{ Form::label('objective_id', 'Objectives') }}
118
                         <label>Associated Outcome</label>
118
                         <label>Associated Outcome</label>
119
 
119
 
120
                         {{ Form::select("assoc_outcome[]", $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome0']) }}
120
                         {{ Form::select("assoc_outcome[]", $outcomes, null, ['class'=>'form-control selectpicker', 'id'=>'assoc_outcome0']) }}
121
-<br><br>
121
+                        <br><br>
122
                     </div>
122
                     </div>
123
-                    
123
+
124
                 </div>
124
                 </div>
125
-                
125
+
126
                 <button id='button-add-assoc-outcome' class='btn btn-md btn-secondary' onclick='addAssoc()'>
126
                 <button id='button-add-assoc-outcome' class='btn btn-md btn-secondary' onclick='addAssoc()'>
127
                     <span class='glyphicon glyphicon-plus'>
127
                     <span class='glyphicon glyphicon-plus'>
128
 
128
 
137
                     <br>
137
                     <br>
138
 
138
 
139
 
139
 
140
-                    <input type ="hidden" id='assoc_program_id_{{ $programs[0]->id }}' name="program_id[]" value="{{$programs[0]->id}}">
141
-                   
140
+                    <input type="hidden" id='assoc_program_id_{{ $programs[0]->id }}' name="program_id[]" value="{{$programs[0]->id}}">
141
+
142
                     <input type="checkbox" id="{{ $programs[0]->name }}" id="assoc_program_id_{{$programs[0]->id}}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
142
                     <input type="checkbox" id="{{ $programs[0]->name }}" id="assoc_program_id_{{$programs[0]->id}}" name="program_id[]" value="{{$programs[0]->id}}" disabled checked>
143
                     <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
143
                     <label for="{{ $programs[0]->name }}"> {{ $programs[0]->name }} [{{ $programs[0]->school->name }}]</label><br>
144
 
144
 
168
                 {{ Form::close() }}
168
                 {{ Form::close() }}
169
 
169
 
170
                 <form action="/deleteObjective" method="POST" id='deleteObj'>
170
                 <form action="/deleteObjective" method="POST" id='deleteObj'>
171
-                
172
-                    
171
+
172
+
173
                 </form>
173
                 </form>
174
             </div>
174
             </div>
175
 
175
 
181
     </div>
181
     </div>
182
 </div>
182
 </div>
183
 <script>
183
 <script>
184
+    $('.filterSection').hide();
184
 
185
 
185
-$('.filterSection').hide();
186
-	
187
-    $('.filterButton').on('click', function()
188
-{
189
-  var span = $(this).find('span');
190
-  if(span.attr('class') == 'glyphicon glyphicon-plus'){
191
-    span.attr('class','glyphicon glyphicon-minus');
192
-  } else{	
193
-    span.attr('class','glyphicon glyphicon-plus');
194
-	
195
-  }
186
+    $('.filterButton').on('click', function() {
187
+        var span = $(this).find('span');
188
+        if (span.attr('class') == 'glyphicon glyphicon-plus') {
189
+            span.attr('class', 'glyphicon glyphicon-minus');
190
+        } else {
191
+            span.attr('class', 'glyphicon glyphicon-plus');
196
 
192
 
197
-  $('.filterSection').toggle(533);
193
+        }
198
 
194
 
199
-});
195
+        $('.filterSection').toggle(533);
196
+
197
+    });
200
     var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
198
     var outcomeHTML = document.getElementById('outcomeGroup').innerHTML;
201
     var selectOptions = document.getElementById('outcome[0]').innerHTML;
199
     var selectOptions = document.getElementById('outcome[0]').innerHTML;
202
     var ran = false;
200
     var ran = false;
203
-   
201
+
204
     function fetchAllObjectives(program, outcome) {
202
     function fetchAllObjectives(program, outcome) {
205
         var program_id_fetch = $('#' + program).find(':selected').val();
203
         var program_id_fetch = $('#' + program).find(':selected').val();
206
         var outcome_fetch = $('#' + outcome).find(':selected').val();
204
         var outcome_fetch = $('#' + outcome).find(':selected').val();
433
             'json'
431
             'json'
434
         );
432
         );
435
     }
433
     }
436
-   
434
+
437
 
435
 
438
     function deleteLastAssoc() {
436
     function deleteLastAssoc() {
439
 
437
 
440
-        div = document.getElementById('assocOutcomeForm' + (i).toString());
438
+        div = document.getElementById('assocOutcomeForm' + (counterAssoc - 1).toString());
441
         div.remove();
439
         div.remove();
442
-        button = document.getElementById('closeAssoc' + (i).toString());
440
+        button = document.getElementById('closeAssoc' + (counterAssoc - 1).toString());
443
         button.remove();
441
         button.remove();
444
         counterAssoc -= 1;
442
         counterAssoc -= 1;
443
+        $('#counterAssoc').val(counterAssoc);
445
 
444
 
446
     }
445
     }
447
 
446
 
452
             'class': "selectpicker form-control",
451
             'class': "selectpicker form-control",
453
             'name': "assoc_outcome[]",
452
             'name': "assoc_outcome[]",
454
             'data-live-search': 'true',
453
             'data-live-search': 'true',
455
-            'id': 'assoc_outcome' + counterAssoc.toString()
454
+            'id': 'assoc_outcome' + counterAssoc.toString(),
455
+            'onchange': 'fetchObjectiveForSelect("outcome' + counter + '", this.value, ' + counterAssoc + ')'
456
 
456
 
457
         });
457
         });
458
         var $div = $('<div />', {
458
         var $div = $('<div />', {
481
 
481
 
482
         ran = true;
482
         ran = true;
483
         counterAssoc += 1;
483
         counterAssoc += 1;
484
+        $('#counterAssoc').val(counterAssoc);
485
+
484
 
486
 
485
 
487
 
486
     }
488
     }
502
 // setCriterionStatus();
504
 // setCriterionStatus();
503
 
505
 
504
 
506
 
505
- 
507
+
506
 fetchAllObjectives("select-program", "assoc_outcomes_fetch")
508
 fetchAllObjectives("select-program", "assoc_outcomes_fetch")
507
 
509
 
508
 
510