Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15573 Rev 16822
Línea 14... Línea 14...
14
$allowDelete            = $acl->isAllowed($roleName, 'publications/pages/delete') ? 1 : 0;
14
$allowDelete            = $acl->isAllowed($roleName, 'publications/pages/delete') ? 1 : 0;
Línea 15... Línea 15...
15
 
15
 
16
$typeURL = \LeadersLinked\Model\Page::TYPE_URL;
16
$typeURL = \LeadersLinked\Model\Page::TYPE_URL;
Línea 17... Línea 17...
17
$typePAGE = \LeadersLinked\Model\Page::TYPE_PAGE;
17
$typePAGE = \LeadersLinked\Model\Page::TYPE_PAGE;
18
 
18
 
Línea 19... Línea 19...
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
 
22
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
22
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
Línea 23... Línea 23...
23
 
23
 
24
 
24
 
Línea 25... Línea 25...
25
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
25
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
26
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
27
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
28
 
28
 
Línea 29... Línea 29...
29
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
29
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
30
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
30
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
Línea 31... Línea -...
31
 
-
 
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
-
 
Línea 33... Línea -...
33
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
-
 
34
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
-
 
35
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
-
 
Línea -... Línea 31...
-
 
31
 
-
 
32
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
-
 
33
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
-
 
34
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
-
 
35
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
36
 
36
 
Línea 37... Línea 37...
37
 
37
 
Línea 188... Línea 188...
188
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
188
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
189
                },
189
                },
190
            },
190
            },
191
            'drawCallback': function( settings ) {
191
            'drawCallback': function( settings ) {
192
                NProgress.done();
192
                NProgress.done();
193
                $('button.btn-delete').confirmation({
-
 
194
                    rootSelector: 'button.btn-delete',
-
 
195
                    title : 'LABEL_ARE_YOU_SURE',
-
 
196
                    singleton : true,
-
 
197
                    btnOkLabel: 'LABEL_YES',
-
 
198
                    btnCancelLabel: 'LABEL_NO',
-
 
199
                    onConfirm: function(value) {
-
 
200
                        action = $(this).data('href');
-
 
201
                        NProgress.start();
-
 
202
                        $.ajax({
-
 
203
                            'dataType'  : 'json',
-
 
204
                            'accept'    : 'application/json',
-
 
-
 
193
                
205
                            'method'    : 'post',
-
 
206
                            'url'       :  action,
-
 
207
                        }).done(function(response) {
-
 
208
                            if(response['success']) {
-
 
209
                                $.fn.showSuccess(response['data']);
-
 
210
                                gridTable.api().ajax.reload(null, false);
-
 
211
                            } else {
-
 
212
                                $.fn.showError(response['data']);
-
 
213
                            }
-
 
214
                        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
215
                            $.fn.showError(textStatus);
-
 
216
                        }).always(function() {
-
 
217
                            NProgress.done();
-
 
218
                        });
-
 
219
                    },
-
 
220
                });
-
 
221
            },
194
            },
222
            'aoColumns': [
195
            'aoColumns': [
223
                { 'mDataProp': 'code' },
196
                { 'mDataProp': 'code' },
224
                { 'mDataProp': 'title' },
197
                { 'mDataProp': 'title' },
225
                { 'mDataProp': 'status' },
198
                { 'mDataProp': 'status' },
Línea 238... Línea 211...
238
                    'targets': -2,
211
                    'targets': -2,
239
                    'orderable': false,
212
                    'orderable': false,
240
                    'className' : 'text-center',
213
                    'className' : 'text-center',
241
                      'render' : function ( data, type, row ) {
214
                      'render' : function ( data, type, row ) {
Línea 242... Línea 215...
242
                      
215
                      
243
                        checked = data == 'a' ? ' checked="checked" ' : '';
216
                        checked = data == 'a'  ? 'checked' : '';
244
                        return '<div class="checkbox checkbox-success">' +
217
                        return '<div class="form-check">' +
245
                            '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
218
                            '<input type="checkbox" class="form-check-input" disabled="" checked="' + checked + '">' +
246
                            '<label ></label></div>';
219
                            '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
247
                    }
220
                    }
248
                },
221
                },
249
                {
222
                {
250
                    'targets': -1,
223
                    'targets': -1,
Línea 375... Línea 348...
375
            $('#row-list').show();
348
            $('#row-list').show();
Línea 376... Línea 349...
376
            
349
            
Línea -... Línea 350...
-
 
350
 
-
 
351
        });
-
 
352
 
-
 
353
 $('body').on('click', 'button.btn-delete', function(e) { 
-
 
354
        e.preventDefault();
-
 
355
        var action = $(this).data('href');
-
 
356
 
-
 
357
 
-
 
358
          swal.fire({
-
 
359
            title: 'LABEL_ARE_YOU_SURE',
-
 
360
            icon: 'question',
-
 
361
            cancelButtonText: 'LABEL_NO',
-
 
362
            showCancelButton: true,
-
 
363
            confirmButtonText: 'LABEL_YES'
-
 
364
          }).then((result) => {
-
 
365
            if (result.isConfirmed) {
-
 
366
 
-
 
367
                    NProgress.start();
-
 
368
                    $.ajax({
-
 
369
                        'dataType'  : 'json',
-
 
370
                        'accept'    : 'application/json',
-
 
371
                        'method'    : 'post',
-
 
372
                        'url'       :  action,
-
 
373
                    }).done(function(response) {
-
 
374
                        if(response['success']) {
-
 
375
                            $.fn.showSuccess(response['data']);
-
 
376
                            gridTable.api().ajax.reload(null, false);
-
 
377
                        } else {
-
 
378
                            $.fn.showError(response['data']);
-
 
379
                        }
-
 
380
                    }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
381
                        $.fn.showError(textStatus);
-
 
382
                    }).always(function() {
-
 
383
                        NProgress.done();
-
 
384
                    });
-
 
385
            }
377
 
386
       });
378
        });
387
    });
379
 
388