Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16817 | Rev 16845 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 16817 Rev 16822
Línea 11... Línea 11...
11
$allowAdd = $acl->isAllowed($roleName, 'self-evaluation/forms/add') ? 1 : 0;
11
$allowAdd = $acl->isAllowed($roleName, 'self-evaluation/forms/add') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'self-evaluation/forms/edit') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'self-evaluation/forms/edit') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'self-evaluation/forms/delete') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'self-evaluation/forms/delete') ? 1 : 0;
Línea 14... Línea 14...
14
 
14
 
Línea 15... Línea 15...
15
 
15
 
16
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
16
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
Línea 17... Línea 17...
17
 
17
 
18
 
18
 
19
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
19
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
Línea 20... Línea 20...
20
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
20
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
21
 
21
 
Línea 22... Línea 22...
22
 
22
 
23
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
23
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
24
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
24
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
25
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
25
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
Línea 26... Línea 26...
26
 
26
 
27
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
27
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
Línea 28... Línea 28...
28
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
28
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
Línea 29... Línea 29...
29
 
29
 
30
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
30
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
Línea 32... Línea 32...
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
33
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
33
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
Línea 34... Línea -...
34
 
-
 
35
 
-
 
-
 
34
 
-
 
35
 
36
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
36
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.min.css'));
Línea 37... Línea 37...
37
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
37
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
38
 
-
 
-
 
38
 
Línea 39... Línea 39...
39
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.min.js'));
39
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.full.min.js'));
40
 
40
 
Línea 41... Línea 41...
41
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
41
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
42
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
42
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
Línea 43... Línea 43...
43
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
43
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
Línea 498... Línea 498...
498
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
498
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
499
            },
499
            },
500
        },
500
        },
501
        'drawCallback': function(settings) {
501
        'drawCallback': function(settings) {
502
            NProgress.done();
502
            NProgress.done();
503
            $('button.btn-delete').confirmation({
-
 
504
                rootSelector: 'button.btn-delete',
-
 
505
                title: 'LABEL_ARE_YOU_SURE',
-
 
506
                singleton: true,
-
 
507
                btnOkLabel: 'LABEL_YES',
-
 
508
                btnCancelLabel: 'LABEL_NO',
-
 
509
                onConfirm: function(value) {
-
 
510
                    action = $(this).data('href');
-
 
511
                    NProgress.start();
-
 
512
                    $.ajax({
-
 
513
                        'dataType': 'json',
-
 
514
                        'accept': 'application/json',
-
 
515
                        'method': 'post',
-
 
516
                        'url': action,
-
 
517
                    }).done(function(response) {
-
 
518
                        if (response['success']) {
-
 
519
                            $.fn.showSuccess(response['data']);
-
 
520
                            tableForm.fnDraw();
-
 
521
                        } else {
-
 
522
                            $.fn.showError(response['data']);
-
 
523
                        }
-
 
524
                    }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
525
                        $.fn.showError(textStatus);
-
 
526
                    }).always(function() {
-
 
527
                        NProgress.done();
-
 
528
                    });
-
 
529
                },
-
 
530
            });
503
           
531
        },
504
        },
532
        'aoColumns': [{
505
        'aoColumns': [{
533
                'mDataProp': 'name'
506
                'mDataProp': 'name'
534
            },
507
            },
535
            {
508
            {
Línea 553... Línea 526...
553
            {
526
            {
554
                'targets': -2,
527
                'targets': -2,
555
                'orderable': false,
528
                'orderable': false,
556
                'className': 'text-center',
529
                'className': 'text-center',
557
                'render': function(data, type, row) {
530
                'render': function(data, type, row) {
558
                    checked = data == 'a' ? ' checked="checked" ' : '';
531
                    checked = data == 'a'  ? 'checked' : '';
559
                    return '<div class="checkbox checkbox-success">' +
532
                    return '<div class="form-check">' +
560
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
533
                        '<input type="checkbox" class="form-check-input" disabled="" checked="' + checked + '">' +
561
                        '<label ></label></div>';
534
                        '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
562
                }
535
                }
563
            },
536
            },
564
            {
537
            {
565
                'targets': -1,
538
                'targets': -1,
566
                'orderable': false,
539
                'orderable': false,
Línea 1106... Línea 1079...
1106
     * Clicked on remove section
1079
     * Clicked on remove section
1107
     */
1080
     */
1108
    $('body').on('click', 'button.btn-delete-section', function(e) {
1081
    $('body').on('click', 'button.btn-delete-section', function(e) {
1109
        e.preventDefault();
1082
        e.preventDefault();
1110
        var slug = $(this).data('section');
1083
        var slug = $(this).data('section');
-
 
1084
 
1111
        bootbox.confirm({
1085
          swal.fire({
1112
            title: "LABEL_DELETE LABEL_SECTION",
1086
            title: "LABEL_DELETE LABEL_SECTION",
1113
            message: "LABEL_QUESTION_DELETE",
1087
            message: "LABEL_QUESTION_DELETE",
1114
            buttons: {
1088
            icon: 'question',
1115
                cancel: {
1089
            cancelButtonText: 'LABEL_NO',
1116
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
-
 
1117
                },
1090
            showCancelButton: true,
1118
                confirm: {
1091
            confirmButtonText: 'LABEL_YES'
1119
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
-
 
1120
                }
-
 
1121
            },
-
 
1122
            callback: function(result) {
1092
          }).then((result) => {
1123
                if (result) {
1093
            if (result.isConfirmed) {
1124
                    objFormGenerator.deleteSection(slug);
1094
                objFormGenerator.deleteSection(slug);
1125
                    renderSectionData(objFormGenerator.sections);
1095
                renderSectionData(objFormGenerator.sections);
1126
                }
-
 
1127
            }
1096
            }
1128
        });
1097
          });
-
 
1098
 
1129
    });
1099
    });
1130
    /**
1100
    /**
1131
     * Clicked add new question
1101
     * Clicked add new question
1132
     */
1102
     */
1133
    $('body').on('click', 'button.btn-add-question', function(e) {
1103
    $('body').on('click', 'button.btn-add-question', function(e) {
Línea 1201... Línea 1171...
1201
     */
1171
     */
1202
    $('body').on('click', 'button.btn-delete-question', function(e) {
1172
    $('body').on('click', 'button.btn-delete-question', function(e) {
1203
        e.preventDefault();
1173
        e.preventDefault();
1204
        var slug_section = $(this).data('section');
1174
        var slug_section = $(this).data('section');
1205
        var slug = $(this).data('question');
1175
        var slug = $(this).data('question');
-
 
1176
 
1206
        bootbox.confirm({
1177
          swal.fire({
1207
            title: "LABEL_DELETE LABEL_QUESTION",
1178
            title: "LABEL_DELETE LABEL_QUESTION",
1208
            message: "LABEL_QUESTION_DELETE",
1179
            message: "LABEL_QUESTION_DELETE",
1209
            buttons: {
1180
            icon: 'question',
1210
                cancel: {
1181
            cancelButtonText: 'LABEL_NO',
1211
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
-
 
1212
                },
1182
            showCancelButton: true,
1213
                confirm: {
1183
            confirmButtonText: 'LABEL_YES'
1214
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
-
 
1215
                }
-
 
1216
            },
-
 
1217
            callback: function(result) {
1184
          }).then((result) => {
1218
                if (result) {
1185
            if (result.isConfirmed) {
1219
                    objFormGenerator.deleteQuestion(slug_section, slug);
1186
                    objFormGenerator.deleteQuestion(slug_section, slug);
1220
                    renderSectionData(objFormGenerator.sections);
1187
                    renderSectionData(objFormGenerator.sections);
1221
                }
-
 
-
 
1188
 
1222
            }
1189
            }
1223
        });
1190
          });
-
 
1191
 
1224
    });
1192
    });
1225
    /**
1193
    /**
1226
     * Clicked add new Option
1194
     * Clicked add new Option
1227
     */
1195
     */
1228
    $('body').on('click', 'button.btn-add-option', function(e) {
1196
    $('body').on('click', 'button.btn-add-option', function(e) {
Línea 1323... Línea 1291...
1323
    $('body').on('click', 'button.btn-delete-option', function(e) {
1291
    $('body').on('click', 'button.btn-delete-option', function(e) {
1324
        e.preventDefault();
1292
        e.preventDefault();
1325
        var slug_section = $(this).data('section');
1293
        var slug_section = $(this).data('section');
1326
        var slug_question = $(this).data('question');
1294
        var slug_question = $(this).data('question');
1327
        var slug = $(this).data('slug');
1295
        var slug = $(this).data('slug');
-
 
1296
 
1328
        bootbox.confirm({
1297
          swal.fire({
1329
            title: "LABEL_DELETE LABEL_OPTION",
1298
            title: "LABEL_DELETE LABEL_OPTION",
1330
            message: "LABEL_QUESTION_DELETE",
1299
            message: "LABEL_QUESTION_DELETE",
1331
            buttons: {
1300
            icon: 'question',
1332
                cancel: {
1301
            cancelButtonText: 'LABEL_NO',
1333
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
-
 
1334
                },
1302
            showCancelButton: true,
1335
                confirm: {
1303
            confirmButtonText: 'LABEL_YES'
1336
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
-
 
1337
                }
-
 
1338
            },
-
 
1339
            callback: function(result) {
1304
          }).then((result) => {
1340
                if (result) {
1305
            if (result.isConfirmed) {
1341
                    objFormGenerator.deleteOption(slug_section, slug_question, slug);
1306
                objFormGenerator.deleteOption(slug_section, slug_question, slug);
1342
                    renderSectionData(objFormGenerator.sections);
1307
                renderSectionData(objFormGenerator.sections);
1343
                }
-
 
1344
            }
1308
            }
1345
        });
1309
          });
-
 
1310
 
-
 
1311
        
1346
    })
1312
    })
1347
    /**
1313
    /**
1348
     * Format input number (Form Section)
1314
     * Format input number (Form Section)
1349
     */
1315
     */
1350
    $('#form-section #section-value').inputNumberFormat({
1316
    $('#form-section #section-value').inputNumberFormat({
Línea 1477... Línea 1443...
1477
     * Clicked refresh button
1443
     * Clicked refresh button
1478
     */
1444
     */
1479
    $('button.btn-refresh').click(function(e) {
1445
    $('button.btn-refresh').click(function(e) {
1480
        tableForm.fnDraw();
1446
        tableForm.fnDraw();
1481
    });
1447
    });
-
 
1448
 
-
 
1449
 $('body').on('click', 'button.btn-delete', function(e) { 
-
 
1450
        e.preventDefault();
-
 
1451
        var action = $(this).data('href');
-
 
1452
 
-
 
1453
 
-
 
1454
          swal.fire({
-
 
1455
            title: 'LABEL_ARE_YOU_SURE',
-
 
1456
            icon: 'question',
-
 
1457
            cancelButtonText: 'LABEL_NO',
-
 
1458
            showCancelButton: true,
-
 
1459
            confirmButtonText: 'LABEL_YES'
-
 
1460
          }).then((result) => {
-
 
1461
            if (result.isConfirmed) {
-
 
1462
 
-
 
1463
                    NProgress.start();
-
 
1464
                    $.ajax({
-
 
1465
                        'dataType'  : 'json',
-
 
1466
                        'accept'    : 'application/json',
-
 
1467
                        'method'    : 'post',
-
 
1468
                        'url'       :  action,
-
 
1469
                    }).done(function(response) {
-
 
1470
                        if(response['success']) {
-
 
1471
                            $.fn.showSuccess(response['data']);
-
 
1472
                            gridTable.api().ajax.reload(null, false);
-
 
1473
                        } else {
-
 
1474
                            $.fn.showError(response['data']);
-
 
1475
                        }
-
 
1476
                    }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
1477
                        $.fn.showError(textStatus);
-
 
1478
                    }).always(function() {
-
 
1479
                        NProgress.done();
-
 
1480
                    });
-
 
1481
            }
-
 
1482
       });
-
 
1483
    });
Línea 1482... Línea 1484...
1482
     
1484
     
1483
});
1485
});
1484
JS;
1486
JS;
1485
$this->inlineScript()->captureEnd();
1487
$this->inlineScript()->captureEnd();
Línea 1575... Línea 1577...
1575
                    </div>
1577
                    </div>
1576
                </div>
1578
                </div>
1577
                <div class="form-group">
1579
                <div class="form-group">
1578
                    <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
1580
                    <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
1579
                    <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
1581
                    <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
1580
                    <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
1582
                    <button type="button" class="btn btn-light btn-edit-cancel">LABEL_CANCEL</button>
1581
                </div>
1583
                </div>
1582
            </form>
1584
            </form>
1583
        </div>
1585
        </div>
1584
    </div>
1586
    </div>
Línea 1612... Línea 1614...
1612
                            <input type="text" name="section-value" id="section-value"  class="form-control" value="0" />
1614
                            <input type="text" name="section-value" id="section-value"  class="form-control" value="0" />
1613
                        </div>
1615
                        </div>
1614
                    </div>
1616
                    </div>
1615
                    <div class="modal-footer">
1617
                    <div class="modal-footer">
1616
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1618
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1617
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1619
                        <button type="button" class="btn btn-light" data-dismiss="modal">LABEL_CLOSE</button>
1618
                    </div>
1620
                    </div>
1619
                </div>
1621
                </div>
1620
            </form>
1622
            </form>
1621
        </div>
1623
        </div>
1622
    </div>
1624
    </div>
Línea 1676... Línea 1678...
1676
                            </select>
1678
                            </select>
1677
                        </div>
1679
                        </div>
1678
                    </div>
1680
                    </div>
1679
                    <div class="modal-footer">
1681
                    <div class="modal-footer">
1680
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1682
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1681
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1683
                        <button type="button" class="btn btn-light" data-dismiss="modal">LABEL_CLOSE</button>
1682
                    </div>
1684
                    </div>
1683
                </div>
1685
                </div>
1684
            </form>
1686
            </form>
1685
        </div>
1687
        </div>
1686
    </div>
1688
    </div>
Línea 1720... Línea 1722...
1720
                            <input type="text" name="option-value" id="option-value" class="form-control" />
1722
                            <input type="text" name="option-value" id="option-value" class="form-control" />
1721
                        </div>
1723
                        </div>
1722
                    </div>
1724
                    </div>
1723
                    <div class="modal-footer">
1725
                    <div class="modal-footer">
1724
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1726
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1725
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1727
                        <button type="button" class="btn btn-light" data-dismiss="modal">LABEL_CLOSE</button>
1726
                    </div>
1728
                    </div>
1727
                </div>
1729
                </div>
1728
            </form>
1730
            </form>
1729
        </div>
1731
        </div>
1730
    </div>
1732
    </div>