Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 20 Rev 28
Línea 5... Línea 5...
5
$roleName = $currentUser->getUserTypeId();
5
$roleName = $currentUser->getUserTypeId();
Línea 6... Línea 6...
6
 
6
 
7
 
7
 
8
$routeAdd       = $this->url('settings/competencies/add');
8
$routeAdd       = $this->url('settings/competencies/add');
Línea 9... Línea 9...
9
$routeDatatable = $this->url('settings/competencies');
9
$routeDatatable = $this->url('settings/competencies');
10
$routeDashboard = $this->url('dashboard');
10
$routeImport    = $this->url('settings/competencies/import');
11
 
11
 
-
 
12
$allowAdd       = $acl->isAllowed($roleName, 'settings/competencies/add') ? 1 : 0;
Línea 12... Línea 13...
12
$allowAdd               = $acl->isAllowed($roleName, 'settings/competencies/add') ? 1 : 0;
13
$allowEdit      = $acl->isAllowed($roleName, 'settings/competencies/edit') ? 1 : 0;
13
$allowEdit              = $acl->isAllowed($roleName, 'settings/competencies/edit') ? 1 : 0;
14
$allowDelete    = $acl->isAllowed($roleName, 'settings/competencies/delete') ? 1 : 0;
Línea 254... Línea 255...
254
                    updateCkeditor:function() {
255
                    updateCkeditor:function() {
255
                        CKEDITOR.instances.description.updateElement();
256
                        CKEDITOR.instances.description.updateElement();
256
                    },
257
                    },
257
                    required: true,
258
                    required: true,
258
                },
259
                },
-
 
260
                'behaviors': {
-
 
261
                    updateCkeditor:function() {
-
 
262
                        CKEDITOR.instances.behaviors.updateElement();
-
 
263
                    },
-
 
264
                    required: true,
-
 
265
                },
-
 
266
 
259
                'status': {
267
                'status': {
260
                    required: false,
268
                    required: false,
Línea 261... Línea 269...
261
                    
269
                    
262
                },
270
                },
Línea 307... Línea 315...
307
            $('#form').attr('action', '$routeAdd');
315
            $('#form').attr('action', '$routeAdd');
308
            $('#form #name').val('');
316
            $('#form #name').val('');
309
            $('#form #competency_type_id').val('').trigger('change');
317
            $('#form #competency_type_id').val('').trigger('change');
310
            $('#form #status').bootstrapToggle('on');
318
            $('#form #status').bootstrapToggle('on');
311
            CKEDITOR.instances.description.setData('');
319
            CKEDITOR.instances.description.setData('');
-
 
320
            CKEDITOR.instances.behaviors.setData('');
Línea 312... Línea 321...
312
 
321
 
313
 
322
 
-
 
323
            validator.resetForm();
-
 
324
            $('#modal').modal('show');
314
            validator.resetForm();
325
 
Línea 315... Línea 326...
315
            $('#modal').modal('show');
326
            return false;
316
        });
327
        });
317
        
328
        
Línea 331... Línea 342...
331
                    $('#form').attr('action', action);
342
                    $('#form').attr('action', action);
332
                    $('#form #name').val(response['data']['name']);
343
                    $('#form #name').val(response['data']['name']);
333
                    $('#form #competency_type_id').val(response['data']['competency_type_id']).trigger('change');
344
                    $('#form #competency_type_id').val(response['data']['competency_type_id']).trigger('change');
334
                    $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
345
                    $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
335
                    CKEDITOR.instances.description.setData(response['data']['description']);
346
                    CKEDITOR.instances.description.setData(response['data']['description']);
336
 
-
 
-
 
347
                    CKEDITOR.instances.behaviors.setData(response['data']['behaviors']);
337
                    validator.resetForm();
348
                    validator.resetForm();
Línea 338... Línea 349...
338
                    
349
                    
Línea 339... Línea 350...
339
                    $('#modal').modal('show');
350
                    $('#modal').modal('show');
Línea 344... Línea 355...
344
            }).fail(function( jqXHR, textStatus, errorThrown) {
355
            }).fail(function( jqXHR, textStatus, errorThrown) {
345
                $.fn.showError(textStatus);
356
                $.fn.showError(textStatus);
346
            }).always(function() {
357
            }).always(function() {
347
                NProgress.done();
358
                NProgress.done();
348
            });
359
            });
-
 
360
 
-
 
361
            return false;
349
        });
362
        });
Línea 350... Línea 363...
350
 
363
 
351
        $('body').on('click', 'button.btn-refresh', function(e) {
364
        $('body').on('click', 'button.btn-refresh', function(e) {
352
            e.preventDefault();
365
            e.preventDefault();
-
 
366
            gridTable.api().ajax.reload(null, false);
-
 
367
 
-
 
368
            return false;
-
 
369
        });
-
 
370
 
-
 
371
        $('body').on('click', 'button.btn-import', function(e) {
-
 
372
            e.preventDefault();
-
 
373
 
-
 
374
            NProgress.start();
-
 
375
 
-
 
376
 
-
 
377
            $.ajax({
-
 
378
                'dataType'  : 'json',
-
 
379
                'method'    : 'post',
-
 
380
                'url'       : '$routeImport',
-
 
381
            }).done(function(response) {
-
 
382
                if(response['success']) {
-
 
383
                    $.fn.showSuccess(response['data']);
-
 
384
                    gridTable.api().ajax.reload(null, false);
-
 
385
                } else {
-
 
386
                    $.fn.showError(response['data']);
-
 
387
                }
-
 
388
            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
389
                $.fn.showError(textStatus);
-
 
390
            }).always(function() {
-
 
391
                NProgress.done();
-
 
392
            });
-
 
393
 
353
            gridTable.api().ajax.reload(null, false);
394
            return false;
Línea 354... Línea 395...
354
        });
395
        });
355
        
396
        
Línea 365... Línea 406...
365
        });
406
        });
Línea 366... Línea 407...
366
 
407
 
367
 
408
 
-
 
409
 
368
 
410
        $('#form #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
369
        $('#form #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
411
        CKEDITOR.replace( 'description' );
370
        CKEDITOR.replace( 'description');
412
        CKEDITOR.replace( 'behaviors' );
371
    });
413
    });
Línea 408... Línea 450...
408
                    	</table>
450
                    	</table>
409
                   	</div>
451
                   	</div>
410
                   	<div class="card-footer clearfix">
452
                   	<div class="card-footer clearfix">
411
                   		<div style="float:right;">
453
                   		<div style="float:right;">
412
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
454
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
-
 
455
							<?php if($allowImport) : ?>
-
 
456
							<button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
-
 
457
							<?php endif; ?>
413
							<?php if($allowAdd) : ?>
458
							<?php if($allowAdd) : ?>
414
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
459
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
415
							<?php endif; ?>
460
							<?php endif; ?>
416
						</div>
461
						</div>
417
                 	</div>
462
                 	</div>
Línea 472... Línea 517...
472
 
517
 
473
                            echo $this->formLabel($element);
518
                            echo $this->formLabel($element);
474
                            echo $this->formTextArea($element);
519
                            echo $this->formTextArea($element);
475
                        ?>
520
                        ?>
-
 
521
						</div>
-
 
522
						
-
 
523
						<div class="form-group">
-
 
524
                    	<?php 
-
 
525
                            $element = $form->get('behaviors');
-
 
526
                            $element->setOptions(['label' => 'LABEL_BEHAVIORS']);
-
 
527
                            $element->setAttributes(['class' => 'form-control']); 
-
 
528
 
-
 
529
                            echo $this->formLabel($element);
-
 
530
                            echo $this->formTextArea($element);
-
 
531
                        ?>
-
 
532
						</div>
-
 
533
						
476
						</div>
534
						
477
						<div class="form-group">
535
						<div class="form-group">
478
                      	<?php 
536
                      	<?php 
479
                            $element = $form->get('status');
537
                            $element = $form->get('status');
480
                            echo $this->formCheckbox($element);
538
                            echo $this->formCheckbox($element);