Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 5711 Rev 16822
Línea 1... Línea 1...
1
<?php
1
\<?php 
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
3
$currentUser    = $this->currentUserHelper();
Línea 4... Línea 4...
4
 
4
 
Línea 34... Línea 34...
34
 
34
 
35
 
35
 
Línea 36... Línea -...
36
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
-
 
37
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
-
 
-
 
36
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
Línea 38... Línea 37...
38
 
37
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
Línea 85... Línea 84...
85
                    error.insertAfter(field.parent());
84
                    error.insertAfter(field.parent());
86
                }
85
                }
87
            }
86
            }
88
        };
87
        };
Línea -... Línea 88...
-
 
88
 
-
 
89
 
-
 
90
 
-
 
91
 
89
 
92
 
90
        var allowEdit   = $allowEdit;
93
        var allowEdit   = $allowEdit;
Línea 91... Línea 94...
91
        var allowDelete = $allowDelete;
94
        var allowDelete = $allowDelete;
92
        
95
        
93
        /* var gridTable = $('#gridTable').dataTable( {
96
        var gridTable = $('#gridTable').dataTable( {
94
            'processing': true,
97
            'processing': true,
95
            'serverSide': true,
98
            'serverSide': true,
96
            'searching': true,
99
            'searching': true,
Línea 151... Línea 154...
151
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
154
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
152
                },
155
                },
153
            },
156
            },
154
            'drawCallback': function( settings ) {
157
            'drawCallback': function( settings ) {
155
                NProgress.done();
158
                NProgress.done();
156
                $('button.btn-delete').confirmation({
-
 
157
                    rootSelector: 'button.btn-delete',
-
 
158
                    title : 'LABEL_ARE_YOU_SURE',
-
 
159
                    singleton : true,
-
 
160
                    btnOkLabel: 'LABEL_YES',
-
 
161
                    btnCancelLabel: 'LABEL_NO',
-
 
162
                    onConfirm: function(value) {
-
 
163
                        action = $(this).data('href');
-
 
164
                        NProgress.start();
-
 
165
                        $.ajax({
-
 
166
                            'dataType'  : 'json',
-
 
167
                            'accept'    : 'application/json',
-
 
-
 
159
                
168
                            'method'    : 'post',
-
 
169
                            'url'       :  action,
-
 
170
                        }).done(function(response) {
-
 
171
                            if(response['success']) {
-
 
172
                                $.fn.showSuccess(response['data']);
-
 
173
                                gridTable.api().ajax.reload(null, false);
-
 
174
                            } else {
-
 
175
                                $.fn.showError(response['data']);
-
 
176
                            }
-
 
177
                        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
178
                            $.fn.showError(textStatus);
-
 
179
                        }).always(function() {
-
 
180
                            NProgress.done();
-
 
181
                        });
-
 
182
                    },
-
 
183
                });
-
 
184
            },
160
            },
185
            'aoColumns': [
161
            'aoColumns': [
Línea 186... Línea 162...
186
    
162
    
187
                { 'mDataProp': 'name' },
163
                { 'mDataProp': 'name' },
Línea 198... Línea 174...
198
                    'targets': -2,
174
                    'targets': -2,
199
                    'orderable': false,
175
                    'orderable': false,
200
                    'className' : 'text-center',
176
                    'className' : 'text-center',
201
                      'render' : function ( data, type, row ) {
177
                      'render' : function ( data, type, row ) {
Línea 202... Línea 178...
202
                      
178
                      
203
                        checked = data == 'a' ? ' checked="checked" ' : '';
179
                        checked = data == 'a'  ? 'checked' : '';
204
                        return '<div class="checkbox checkbox-success">' +
180
                        return '<div class="form-check">' +
205
                            '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
181
                            '<input type="checkbox" class="form-check-input" disabled="" checked="' + checked + '">' +
206
                            '<label ></label></div>';
182
                            '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
207
                    }
183
                    }
208
                },
184
                },
209
                {
185
                {
210
                    'targets': -1,
186
                    'targets': -1,
Línea 340... Línea 316...
340
            e.preventDefault();
316
            e.preventDefault();
341
            $('#modal').modal('hide');
317
            $('#modal').modal('hide');
342
            $('#div-listing').show();
318
            $('#div-listing').show();
343
        });
319
        });
Línea -... Línea 320...
-
 
320
 
-
 
321
    $('body').on('click', 'button.btn-delete', function(e) { 
-
 
322
        e.preventDefault();
-
 
323
        var action = $(this).data('href');
-
 
324
 
-
 
325
 
-
 
326
          swal.fire({
-
 
327
            title: 'LABEL_ARE_YOU_SURE',
-
 
328
            icon: 'question',
-
 
329
            cancelButtonText: 'LABEL_NO',
-
 
330
            showCancelButton: true,
-
 
331
            confirmButtonText: 'LABEL_YES'
-
 
332
          }).then((result) => {
-
 
333
            if (result.isConfirmed) {
-
 
334
 
-
 
335
                    NProgress.start();
-
 
336
                    $.ajax({
-
 
337
                        'dataType'  : 'json',
-
 
338
                        'accept'    : 'application/json',
-
 
339
                        'method'    : 'post',
-
 
340
                        'url'       :  action,
-
 
341
                    }).done(function(response) {
-
 
342
                        if(response['success']) {
-
 
343
                            $.fn.showSuccess(response['data']);
-
 
344
                            gridTable.api().ajax.reload(null, false);
-
 
345
                        } else {
-
 
346
                            $.fn.showError(response['data']);
-
 
347
                        }
-
 
348
                    }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
349
                        $.fn.showError(textStatus);
-
 
350
                    }).always(function() {
-
 
351
                        NProgress.done();
-
 
352
                    });
-
 
353
                }
-
 
354
           });
-
 
355
        });
Línea 344... Línea 356...
344
 
356
 
345
 
357
 
346
        $('#form #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
358
        $('#form #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
347
        CKEDITOR.replace( 'description'); */
359
        CKEDITOR.replace( 'description');
348
    });
360
    });
349
JS;
-
 
350
$this->inlineScript()->captureEnd();
-
 
351
 
-
 
352
$js = <<<JS
-
 
353
const urlsVar = {
-
 
354
        linkTable: '$routeDatatable',
-
 
355
        addUrl: '$routeAdd',
-
 
356
        allowAdd: '$allowAdd',
-
 
357
        allowEdit: '$allowEdit',
-
 
358
        allowDelete: '$allowDelete',
-
 
359
   }
-
 
360
JS;
-
 
361
 
-
 
362
$this->inlineScript()->appendScript($js);
361
JS;
-
 
362
$this->inlineScript()->captureEnd();
Línea -... Línea 363...
-
 
363
?>
-
 
364
			
-
 
365
 
-
 
366
			
-
 
367
<div class="container">
-
 
368
	<div class="card">
-
 
369
		<h6 class="card-title">LABEL_JOB_CATEGORIES</h6>
-
 
370
		<div class="card-body">
-
 
371
    	<div class="row">
-
 
372
        	<div class="col-12">
-
 
373
				<div class="card">                    
-
 
374
					<div class="card-body">
-
 
375
        	    		<table id="gridTable" class="table   table-hover">
-
 
376
                      		<thead>
-
 
377
        						<tr>
-
 
378
                                	<th>LABEL_NAME</th>
-
 
379
                                  	<th>LABEL_ACTIVE</th>
-
 
380
                                  	<th>LABEL_ACTIONS</th>
-
 
381
                                </tr>
-
 
382
                       		</thead>
-
 
383
                         	<tbody>
-
 
384
                         	</tbody>
-
 
385
                    	</table>
-
 
386
                   	</div>
-
 
387
                   	<div class="card-footer clearfix">
-
 
388
                   		<div style="float:right;">
-
 
389
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
-
 
390
							<?php if($allowAdd) : ?>
-
 
391
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
-
 
392
							<?php endif; ?>
-
 
393
						</div>
-
 
394
                 	</div>
-
 
395
          		</div>
-
 
396
           	</div>     
-
 
397
        </div>          
-
 
398
 	</div>
-
 
399
</div>
-
 
400
</div>
-
 
401
 
-
 
402
<!-- The Modal -->
-
 
403
<div class="modal" id="modal">
-
 
404
	<div class="modal-dialog  modal-xl">
-
 
405
    	<div class="modal-content">
-
 
406
 
-
 
407
            <!-- Modal Header -->
-
 
408
      		<div class="modal-header">
-
 
409
        		<h4 class="modal-title">LABEL_JOB_CATEGORIES - <span id="form-title"></span></h4>
-
 
410
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
-
 
411
      		</div>
-
 
412
 
-
 
413
            <!-- Modal body -->
-
 
414
      		<div class="modal-body">
-
 
415
       			 <?php 
-
 
416
                    $form = $this->form;
-
 
417
            		$form->setAttributes([
-
 
418
                        'method'    => 'post',
-
 
419
                        'name'      => 'form',
-
 
420
                        'id'        => 'form'
-
 
421
                    ]);
-
 
422
    
-
 
423
                    $form->prepare();
-
 
424
                    echo $this->form()->openTag($form);
-
 
425
                    ?>					
-
 
426
    					<div class="form-group">
-
 
427
        					<?php 
-
 
428
                            $element = $form->get('name');
-
 
429
                            $element->setOptions(['label' => 'LABEL_NAME']);
-
 
430
                            $element->setAttributes(['class' => 'form-control']); 
-
 
431
                                            
-
 
432
                            echo $this->formLabel($element);
-
 
433
                            echo $this->formText($element);
-
 
434
                            ?>
-
 
435
						</div>
-
 
436
						<div class="form-group">
-
 
437
                    	<?php 
-
 
438
                            $element = $form->get('description');
-
 
439
                            $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
-
 
440
                            $element->setAttributes(['class' => 'form-control']); 
-
 
441
 
-
 
442
                            echo $this->formLabel($element);
-
 
443
                            echo $this->formTextArea($element);
-
 
444
                        ?>
-
 
445
						</div>
-
 
446
						<div class="form-group">
-
 
447
                      	<?php 
-
 
448
                            $element = $form->get('status');
-
 
449
                            echo $this->formCheckbox($element);
-
 
450
                        ?>
-
 
451
						</div>
-
 
452
								
-
 
453
        				<div class="form-group">
-
 
454
                    		<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
455
                    		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
-
 
456
                   		</div>
-
 
457
     	      		<?php echo $this->form()->closeTag($form); ?>
-
 
458
      		</div>
-
 
459
 
-
 
460
            <!-- Modal footer -->
-
 
461
      		<div class="modal-footer">
-
 
462
        		 <button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
-
 
463
      		</div>
-
 
464
 
-
 
465
    	</div>
Línea -... Línea 466...
-
 
466
	</div>
-
 
467
</div>   			
-
 
468
			
-
 
469
 
Línea 363... Línea -...
363
$this->inlineScript()->appendFile('/react-bundles/settings/job-categories/jobCategoriesBundle.js');
-
 
Línea 364... Línea -...
364
?>
-
 
365
 
-
 
366
 
470
 
-
 
471