Browse Source

Editar criterio

parent
commit
95b4986d7d

+ 35
- 35
app/views/local/managers/admins/criteria.blade.php View File

156
                             onchange='fetchCriterionForEditing()'>
156
                             onchange='fetchCriterionForEditing()'>
157
                             @foreach ($criteria as $criterion)
157
                             @foreach ($criteria as $criterion)
158
                                 <option value="{{ $criterion->id }}" data-subtext="
158
                                 <option value="{{ $criterion->id }}" data-subtext="
159
-                                                            @if ($criterion->program)
159
+                                                                 @if ($criterion->program)
160
                                     &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
160
                                     &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
161
                             @endif
161
                             @endif
162
                             ">
162
                             ">
1339
                             $("#update_the_criterion_button").val("Create New")
1339
                             $("#update_the_criterion_button").val("Create New")
1340
                             $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
1340
                             $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
1341
                             $('#alert_placeholder').html(
1341
                             $('#alert_placeholder').html(
1342
-                                '<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> The criterion is already used in assessments. Editting the criterion will actually create a new criterion </div>'
1342
+                                '<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>'
1343
                             );
1343
                             );
1344
 
1344
 
1345
 
1345
 
1520
 
1520
 
1521
 
1521
 
1522
                     /*
1522
                     /*
1523
-                                assocOutcomeCounter = 0;
1524
-                                var i = 0;
1525
-                                optionName = '<option value ="0">Nothing Selected</option>';
1526
-                                for(outcome in json.outcomes_assoc){
1527
-                                    optionName += '<optgroup label="' + json.outcomes_assoc[outcome][0].name + '">';
1528
-                                    var objectiveForOutcome = json.objectives_assoc;
1529
-                                    var objectives = objectiveForOutcome[outcome];
1530
-                                    for (objective in objectives) {
1531
-                                
1532
-
1533
-                                        var obj= objectives[objective];
1534
-                                        var option = '<option value ="' + obj.id + '">' +obj.text + '</option>';
1535
-                                        optionName += (option);
1523
+                                    assocOutcomeCounter = 0;
1524
+                                    var i = 0;
1525
+                                    optionName = '<option value ="0">Nothing Selected</option>';
1526
+                                    for(outcome in json.outcomes_assoc){
1527
+                                        optionName += '<optgroup label="' + json.outcomes_assoc[outcome][0].name + '">';
1528
+                                        var objectiveForOutcome = json.objectives_assoc;
1529
+                                        var objectives = objectiveForOutcome[outcome];
1530
+                                        for (objective in objectives) {
1531
+                                    
1532
+
1533
+                                            var obj= objectives[objective];
1534
+                                            var option = '<option value ="' + obj.id + '">' +obj.text + '</option>';
1535
+                                            optionName += (option);
1536
+                                        }
1537
+                                        optionName += "</optgroup>";
1536
                                     }
1538
                                     }
1537
-                                    optionName += "</optgroup>";
1538
-                                }
1539
 
1539
 
1540
 
1540
 
1541
-                                $('#assoc_objective_0').html(optionName);
1542
-                                $('#assoc_objective_0').selectpicker('refresh');
1543
-                                
1541
+                                    $('#assoc_objective_0').html(optionName);
1542
+                                    $('#assoc_objective_0').selectpicker('refresh');
1543
+                                    
1544
 
1544
 
1545
 
1545
 
1546
 
1546
 
1547
-                                try {
1548
-                                    $('#assoc_objective_0').val(json.objectives[0].id);
1549
-                                    $('#assoc_objective_0').selectpicker('refresh');
1550
-                                } catch (err) {
1551
-                                    if (!json.objectives.length) {
1552
-                                        $('#assoc_objective_0').val(0);
1547
+                                    try {
1548
+                                        $('#assoc_objective_0').val(json.objectives[0].id);
1553
                                         $('#assoc_objective_0').selectpicker('refresh');
1549
                                         $('#assoc_objective_0').selectpicker('refresh');
1550
+                                    } catch (err) {
1551
+                                        if (!json.objectives.length) {
1552
+                                            $('#assoc_objective_0').val(0);
1553
+                                            $('#assoc_objective_0').selectpicker('refresh');
1554
+                                        }
1555
+                                    
1554
                                     }
1556
                                     }
1555
-                                
1556
-                                }
1557
 
1557
 
1558
-                                for (var i = 1; i < json.objectives.length; i++) {
1559
-                                    addAssocObjective();
1560
-                                    $('#assoc_objective_' + i.toString()).val(json.objectives[i].id);
1561
-                                    $('#assoc_objective_' + i.toString()).selectpicker('refresh');
1562
-                                }
1563
-                                $('assoc_objectiveGroup').data('value',json.objectives.length);
1558
+                                    for (var i = 1; i < json.objectives.length; i++) {
1559
+                                        addAssocObjective();
1560
+                                        $('#assoc_objective_' + i.toString()).val(json.objectives[i].id);
1561
+                                        $('#assoc_objective_' + i.toString()).selectpicker('refresh');
1562
+                                    }
1563
+                                    $('assoc_objectiveGroup').data('value',json.objectives.length);
1564
 
1564
 
1565
 
1565
 
1566
-                */
1566
+                    */
1567
 
1567
 
1568
 
1568
 
1569
 
1569
 

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

154
                             onchange='fetchCriterionForEditing()'>
154
                             onchange='fetchCriterionForEditing()'>
155
                             @foreach ($criteria as $criterion)
155
                             @foreach ($criteria as $criterion)
156
                                 <option value="{{ $criterion->id }}" data-subtext="
156
                                 <option value="{{ $criterion->id }}" data-subtext="
157
-                                             @if ($criterion->program)
157
+                                                  @if ($criterion->program)
158
                                     &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
158
                                     &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
159
                             @endif
159
                             @endif
160
                             ">
160
                             ">
210
                     <!-- Associated Program -->
210
                     <!-- Associated Program -->
211
                     <div class="form-group form_validation program_form"">
211
                     <div class="form-group form_validation program_form"">
212
 
212
 
213
-                        {{ Form::label('program_id2', 'Associated Program') }}<br><br>
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
                         value="{{ $programs[0]->id }}">
216
                         value="{{ $programs[0]->id }}">
217
 
217
 
218
                         <input type="checkbox" id="assoc_program_id_{{ $programs[0]->id }}" name="program_id[]"
218
                         <input type="checkbox" id="assoc_program_id_{{ $programs[0]->id }}" name="program_id[]"
1250
                             $("#update_the_criterion_button").val("Create New")
1250
                             $("#update_the_criterion_button").val("Create New")
1251
                             $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
1251
                             $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
1252
                             $('#alert_placeholder').html(
1252
                             $('#alert_placeholder').html(
1253
-                                '<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> The criterion is already used in assessments. Editting the criterion will actually create a new criterion </div>'
1253
+                                '<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>'
1254
                             );
1254
                             );
1255
 
1255
 
1256
                         }
1256
                         }

+ 4
- 3
app/views/local/managers/sCoords/criteria.blade.php View File

143
                             {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class' => 'form-control selectpicker', 'id' => 'assoc_outcomes_fetch', 'onchange' => 'fetchAllCriterion("select-program", "assoc_outcomes_fetch")']) }}
143
                             {{ Form::select('assoc_outcome_fetch', $outcomes, null, ['class' => 'form-control selectpicker', 'id' => 'assoc_outcomes_fetch', 'onchange' => 'fetchAllCriterion("select-program", "assoc_outcomes_fetch")']) }}
144
 
144
 
145
                         </div>
145
                         </div>
146
+
146
                     </div>
147
                     </div>
147
                     <hr>
148
                     <hr>
148
                     <div class="form-group">
149
                     <div class="form-group">
151
                             onchange='fetchCriterionForEditing()'>
152
                             onchange='fetchCriterionForEditing()'>
152
                             @foreach ($criteria as $criterion)
153
                             @foreach ($criteria as $criterion)
153
                                 <option value="{{ $criterion->id }}" data-subtext="
154
                                 <option value="{{ $criterion->id }}" data-subtext="
154
-               @if ($criterion->program)
155
+                         @if ($criterion->program)
155
                                     &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
156
                                     &nbsp;&nbsp;&nbsp;[{{ $criterion->program->name }}]
156
                             @endif
157
                             @endif
157
                             ">
158
                             ">
1345
                             $("#update_the_criterion_button").val("Create New")
1346
                             $("#update_the_criterion_button").val("Create New")
1346
                             $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
1347
                             $("#update_criterion").attr('action', "{{ URL::action('CriteriaController@create') }}")
1347
                             $('#alert_placeholder').html(
1348
                             $('#alert_placeholder').html(
1348
-                                '<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> The criterion is already used in assessments. Editting the criterion will actually create a new criterion </div>'
1349
+                                '<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>'
1349
                             );
1350
                             );
1350
 
1351
 
1351
 
1352
 
1607
 
1608
 
1608
     $('#outcome-display').parent().hide();
1609
     $('#outcome-display').parent().hide();
1609
 
1610
 
1610
-    fetchCriterionForEditing();
1611
+    //fetchCriterionForEditing();
1611
     fetchObjectiveForSelect('outcome0', 'objectiveGroupFor0');
1612
     fetchObjectiveForSelect('outcome0', 'objectiveGroupFor0');
1612
     // setCriterionStatus();
1613
     // setCriterionStatus();
1613
     fetchAllCriterion("select-program", "assoc_outcomes_fetch");
1614
     fetchAllCriterion("select-program", "assoc_outcomes_fetch");