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, 'survey/form/add') ? 1 : 0;
11
$allowAdd = $acl->isAllowed($roleName, 'survey/form/add') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'survey/form/edit') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'survey/form/edit') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'survey/form/delete') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'survey/form/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 516... Línea 516...
516
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
516
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
517
            },
517
            },
518
        },
518
        },
519
        'drawCallback': function(settings) {
519
        'drawCallback': function(settings) {
520
            NProgress.done();
520
            NProgress.done();
521
            $('button.btn-delete').confirmation({
-
 
522
                rootSelector: 'button.btn-delete',
-
 
523
                title: 'LABEL_ARE_YOU_SURE',
-
 
524
                singleton: true,
-
 
525
                btnOkLabel: 'LABEL_YES',
-
 
526
                btnCancelLabel: 'LABEL_NO',
-
 
527
                onConfirm: function(value) {
-
 
528
                    action = $(this).data('href');
-
 
529
                    NProgress.start();
-
 
530
                    $.ajax({
-
 
531
                        'dataType': 'json',
-
 
532
                        'accept': 'application/json',
-
 
533
                        'method': 'post',
-
 
534
                        'url': action,
-
 
535
                    }).done(function(response) {
-
 
536
                        if (response['success']) {
-
 
537
                            $.fn.showSuccess(response['data']);
-
 
538
                            tableForm.fnDraw();
-
 
539
                        } else {
-
 
540
                            $.fn.showError(response['data']);
-
 
541
                        }
-
 
542
                    }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
543
                        $.fn.showError(textStatus);
-
 
544
                    }).always(function() {
-
 
545
                        NProgress.done();
-
 
546
                    });
-
 
547
                },
-
 
548
            });
521
            
549
        },
522
        },
550
        'aoColumns': [{
523
        'aoColumns': [{
551
                'mDataProp': 'name'
524
                'mDataProp': 'name'
552
            },
525
            },
553
            {
526
            {
Línea 565... Línea 538...
565
                'targets': -2,
538
                'targets': -2,
566
                'orderable': false,
539
                'orderable': false,
567
                'className': 'text-center',
540
                'className': 'text-center',
568
                'render': function(data, type, row) {
541
                'render': function(data, type, row) {
569
                    checked = data == '$status_active' ? ' checked="checked" ' : '';
542
                    checked = data == '$status_active' ? ' checked="checked" ' : '';
570
                    return '<div class="checkbox checkbox-success">' +
543
                    return '<div class="form-check">' +
571
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
544
                        '<input type="checkbox" class="form-check-input" disabled="" checked="' + checked + '">' +
572
                        '<label ></label></div>';
545
                        '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
573
                }
546
                }
574
            },
547
            },
575
            {
548
            {
576
                'targets': -1,
549
                'targets': -1,
577
                'orderable': false,
550
                'orderable': false,
Línea 862... Línea 835...
862
    });
835
    });
Línea 863... Línea 836...
863
 
836
 
864
    $('body').on('click', 'button.btn-delete-section', function(e) {
837
    $('body').on('click', 'button.btn-delete-section', function(e) {
865
        e.preventDefault();
838
        e.preventDefault();
-
 
839
        var slug = $(this).data('section');
866
        var slug = $(this).data('section');
840
 
867
        bootbox.confirm({
841
          swal.fire({
868
            title: "LABEL_DELETE LABEL_SECTION",
842
            title: "LABEL_DELETE LABEL_SECTION",
869
            message: "LABEL_QUESTION_DELETE",
843
            message: "LABEL_QUESTION_DELETE",
870
            buttons: {
844
            icon: 'question',
871
                cancel: {
-
 
872
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
845
            cancelButtonText: 'LABEL_NO',
873
                },
846
            showCancelButton: true,
874
                confirm: {
-
 
875
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
-
 
876
                }
-
 
877
            },
847
            confirmButtonText: 'LABEL_YES'
878
            callback: function(result) {
848
          }).then((result) => {
879
                if (result) {
849
            if (result.isConfirmed) {
880
                    objFormGenerator.deleteSection(slug);
-
 
881
                }
850
                objFormGenerator.deleteSection(slug);
882
            }
851
            }
883
        });
852
        });
Línea 884... Línea 853...
884
    });
853
    });
Línea 925... Línea 894...
925
 
894
 
926
    $('body').on('click', 'button.btn-delete-question', function(e) {
895
    $('body').on('click', 'button.btn-delete-question', function(e) {
927
        e.preventDefault();
896
        e.preventDefault();
928
        var slug_section = $(this).data('section');
897
        var slug_section = $(this).data('section');
-
 
898
        var slug = $(this).data('question');
929
        var slug = $(this).data('question');
899
 
930
        bootbox.confirm({
900
          swal.fire({
931
            title: "LABEL_DELETE LABEL_QUESTION",
901
            title: "LABEL_DELETE LABEL_QUESTION",
932
            message: "LABEL_QUESTION_DELETE",
902
            message: "LABEL_QUESTION_DELETE",
933
            buttons: {
903
            icon: 'question',
934
                cancel: {
-
 
935
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
904
            cancelButtonText: 'LABEL_NO',
936
                },
905
            showCancelButton: true,
937
                confirm: {
-
 
938
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
-
 
939
                }
-
 
940
            },
906
            confirmButtonText: 'LABEL_YES'
941
            callback: function(result) {
907
          }).then((result) => {
942
                if (result) {
908
            if (result.isConfirmed) {
943
                    objFormGenerator.deleteQuestion(slug_section, slug);
-
 
944
                }
909
                    objFormGenerator.deleteQuestion(slug_section, slug);
945
            }
910
            }
946
        });
911
        });
Línea 947... Línea 912...
947
    });
912
    });
Línea 1012... Línea 977...
1012
    $('body').on('click', 'button.btn-delete-option', function(e) {
977
    $('body').on('click', 'button.btn-delete-option', function(e) {
1013
        e.preventDefault();
978
        e.preventDefault();
1014
        var slug_section = $(this).data('section');
979
        var slug_section = $(this).data('section');
1015
        var slug_question = $(this).data('question');
980
        var slug_question = $(this).data('question');
1016
        var slug = $(this).data('slug');
981
        var slug = $(this).data('slug');
-
 
982
 
1017
        bootbox.confirm({
983
          swal.fire({
1018
            title: "LABEL_DELETE LABEL_OPTION",
984
            title: "LABEL_DELETE LABEL_OPTION",
1019
            message: "LABEL_QUESTION_DELETE",
985
            message: "LABEL_QUESTION_DELETE",
1020
            buttons: {
986
            icon: 'question',
1021
                cancel: {
987
            cancelButtonText: 'LABEL_NO',
1022
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
-
 
1023
                },
988
            showCancelButton: true,
1024
                confirm: {
989
            confirmButtonText: 'LABEL_YES'
1025
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
-
 
1026
                }
-
 
1027
            },
-
 
1028
            callback: function(result) {
990
          }).then((result) => {
1029
                if (result) {
991
            if (result.isConfirmed) {
-
 
992
 
1030
                    objFormGenerator.deleteOption(slug_section, slug_question, slug);
993
                    objFormGenerator.deleteOption(slug_section, slug_question, slug);
1031
                }
-
 
-
 
994
    
1032
            }
995
            }
1033
        });
996
        });
1034
    })
997
    })
Línea 1086... Línea 1049...
1086
 
1049
 
1087
    $('button.btn-refresh').click(function(e) {
1050
    $('button.btn-refresh').click(function(e) {
1088
        tableForm.api().ajax.reload(null, false);
1051
        tableForm.api().ajax.reload(null, false);
Línea -... Línea 1052...
-
 
1052
    });
-
 
1053
 
-
 
1054
 $('body').on('click', 'button.btn-delete', function(e) { 
-
 
1055
        e.preventDefault();
-
 
1056
        var action = $(this).data('href');
-
 
1057
 
-
 
1058
 
-
 
1059
          swal.fire({
-
 
1060
            title: 'LABEL_ARE_YOU_SURE',
-
 
1061
            icon: 'question',
-
 
1062
            cancelButtonText: 'LABEL_NO',
-
 
1063
            showCancelButton: true,
-
 
1064
            confirmButtonText: 'LABEL_YES'
-
 
1065
          }).then((result) => {
-
 
1066
            if (result.isConfirmed) {
-
 
1067
 
-
 
1068
                    NProgress.start();
-
 
1069
                    $.ajax({
-
 
1070
                        'dataType'  : 'json',
-
 
1071
                        'accept'    : 'application/json',
-
 
1072
                        'method'    : 'post',
-
 
1073
                        'url'       :  action,
-
 
1074
                    }).done(function(response) {
-
 
1075
                        if(response['success']) {
-
 
1076
                            $.fn.showSuccess(response['data']);
-
 
1077
                            gridTable.api().ajax.reload(null, false);
-
 
1078
                        } else {
-
 
1079
                            $.fn.showError(response['data']);
-
 
1080
                        }
-
 
1081
                    }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
1082
                        $.fn.showError(textStatus);
-
 
1083
                    }).always(function() {
-
 
1084
                        NProgress.done();
-
 
1085
                    });
-
 
1086
            }
-
 
1087
       });
Línea 1089... Línea 1088...
1089
    });
1088
    });
Línea 1090... Línea 1089...
1090
 
1089
 
Línea 1187... Línea 1186...
1187
                    </div>
1186
                    </div>
1188
                </div>
1187
                </div>
1189
                <div class="form-group">
1188
                <div class="form-group">
1190
                    <button type="button" id="btn-form-save-continue" class="btn btn-info ">LABEL_SAVE & LABEL_CONTINUE</button>
1189
                    <button type="button" id="btn-form-save-continue" class="btn btn-info ">LABEL_SAVE & LABEL_CONTINUE</button>
1191
                    <button type="button" id="btn-form-save-close" class="btn btn-primary ">LABEL_SAVE & LABEL_CLOSE</button>
1190
                    <button type="button" id="btn-form-save-close" class="btn btn-primary ">LABEL_SAVE & LABEL_CLOSE</button>
1192
                    <button type="button" id="btn-edit-cancel" class="btn btn-secondary ">LABEL_CANCEL</button>
1191
                    <button type="button" id="btn-edit-cancel" class="btn btn-light ">LABEL_CANCEL</button>
1193
                </div>
1192
                </div>
1194
            </form>
1193
            </form>
1195
        </div>
1194
        </div>
1196
    </div>
1195
    </div>
Línea 1220... Línea 1219...
1220
                            <textarea name="section-text" id="section-text" rows="5" class="ckeditor form-control"></textarea>
1219
                            <textarea name="section-text" id="section-text" rows="5" class="ckeditor form-control"></textarea>
1221
                        </div>
1220
                        </div>
1222
                    </div>
1221
                    </div>
1223
                    <div class="modal-footer">
1222
                    <div class="modal-footer">
1224
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1223
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1225
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1224
                        <button type="button" class="btn btn-light" data-dismiss="modal">LABEL_CLOSE</button>
1226
                    </div>
1225
                    </div>
1227
                </div>
1226
                </div>
1228
            </form>
1227
            </form>
1229
        </div>
1228
        </div>
1230
    </div>
1229
    </div>
Línea 1260... Línea 1259...
1260
                            </select>
1259
                            </select>
1261
                        </div>
1260
                        </div>
1262
                    </div>
1261
                    </div>
1263
                    <div class="modal-footer">
1262
                    <div class="modal-footer">
1264
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1263
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1265
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1264
                        <button type="button" class="btn btn-light" data-dismiss="modal">LABEL_CLOSE</button>
1266
                    </div>
1265
                    </div>
1267
                </div>
1266
                </div>
1268
            </form>
1267
            </form>
1269
        </div>
1268
        </div>
1270
    </div>
1269
    </div>
Línea 1293... Línea 1292...
1293
                            <textarea name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
1292
                            <textarea name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
1294
                        </div>
1293
                        </div>
1295
                    </div>
1294
                    </div>
1296
                    <div class="modal-footer">
1295
                    <div class="modal-footer">
1297
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1296
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1298
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1297
                        <button type="button" class="btn btn-light" data-dismiss="modal">LABEL_CLOSE</button>
1299
                    </div>
1298
                    </div>
1300
                </div>
1299
                </div>
1301
            </form>
1300
            </form>
1302
        </div>
1301
        </div>
1303
    </div>
1302
    </div>