Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15258 Rev 15259
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 239... Línea 239...
239
                    
239
                    
240
                },
240
                },
241
            },
241
            },
242
            submitHandler: function(form)
242
            submitHandler: function(form)
243
            {
243
            {
244
                $('#form .btn-primary').attr("disabled", true);
244
                $('#modal .btn-primary').attr('disabled', true)
245
                $.ajax({
245
                $.ajax({
246
                    'dataType'  : 'json',
246
                    'dataType'  : 'json',
247
                    'accept'    : 'application/json',
247
                    'accept'    : 'application/json',
248
                    'method'    : 'post',
248
                    'method'    : 'post',
249
                    'url'       :  $('#form').attr('action'),
249
                    'url'       :  $('#form').attr('action'),
250
                    'data'      :  $('#form').serialize()
250
                    'data'      :  $('#form').serialize()
251
                }).done(function(response) {
251
                }).done(function(response) {
252
                    NProgress.start();
252
                    NProgress.start();
-
 
253
                    if(response['success']) {
-
 
254
                        $.fn.showSuccess(response['data']);
-
 
255
                        
-
 
256
                        $('#modal').modal('hide');
-
 
257
 
-
 
258
                        
-
 
259
                         gridTable.api().ajax.reload(null, false);
253
                    if(!response['success']) {
260
                    } else {
254
                        validator.resetForm();
261
                        validator.resetForm();
255
                        if(jQuery.type(response['data']) == 'string') {
262
                        if(jQuery.type(response['data']) == 'string') {
-
 
263
                            $.fn.showError(response['data']);
-
 
264
                        } else  {
-
 
265
                            $.each(response['data'], function( fieldname, errors ) {
256
                            $.fn.showError(response['data']);
266
                                $.fn.showFormErrorValidator('#form #' + fieldname, errors);
257
                            return;
267
                            });
258
                        }
-
 
259
                          
-
 
260
                        $.each(response['data'], function( fieldname, errors ) {
-
 
261
                            $.fn.showFormErrorValidator('#form #' + fieldname, errors);
-
 
262
                        });
-
 
263
                        return;
268
                        }
264
                    } 
-
 
265
                    $.fn.showSuccess(response['data']);    
-
 
266
                    $('#modal').modal('hide');
-
 
267
                    gridTable.api().ajax.reload(null, false);
269
                    }
268
                }).fail(function( jqXHR, textStatus, errorThrown) {
270
                }).fail(function( jqXHR, textStatus, errorThrown) {
269
                   $.fn.showError(textStatus);
271
                   $.fn.showError(textStatus);
270
                }).always(function() {
272
                }).always(function() {
271
                    NProgress.done();
273
                    NProgress.done();
272
                });
-
 
273
                $('#form .btn-primary').removeAttr("disabled");
274
                });
274
                return false;
275
                return false;
275
            },
276
            },
Línea 276... Línea 277...
276
            invalidHandler: function(form, validator) {
277
            invalidHandler: function(form, validator) {
Línea 368... Línea 369...
368
    });
369
    });
369
JS;
370
JS;
370
$this->inlineScript()->captureEnd();
371
$this->inlineScript()->captureEnd();
371
?>
372
?>
Línea 372... Línea 373...
372
 
373
 
373
 
374
			
374
 
375
			
375
<!-- Content Header (Page header) -->
376
<!-- Content Header (Page header) -->
376
<section class="content-header">
377
<section class="content-header">
377
    <div class="container-fluid">
378
	<div class="container-fluid">
378
        <div class="row mb-2">
379
    	<div class="row mb-2">
379
            <div class="col-sm-12">
380
        	<div class="col-sm-12">
380
                <h1>LABEL_BEHAVIORS</h1>
381
            	<h1>LABEL_BEHAVIORS</h1>
381
            </div>
382
			</div>
382
        </div>
383
		</div>
383
    </div><!-- /.container-fluid -->
384
	</div><!-- /.container-fluid -->
Línea 384... Línea 385...
384
</section>
385
</section>
385
 
386
 
386
<section class="content">
387
<section class="content">
387
    <div class="container-fluid">
388
	<div class="container-fluid">
388
        <div class="row">
389
    	<div class="row">
389
            <div class="col-12">
390
        	<div class="col-12">
390
                <div class="card">
391
				<div class="card">                    
391
                    <div class="card-body">
392
					<div class="card-body">
392
                        <table id="gridTable" class="table table-striped table-hover">
393
        	    		<table id="gridTable" class="table table-striped table-hover">
393
                            <thead>
394
                      		<thead>
394
                                <tr>
395
        						<tr>
395
                                    <th>LABEL_DESCRIPTION</th>
396
                                	<th>LABEL_DESCRIPTION</th>
396
                                    <th>LABEL_ACTIVE</th>
397
                                  	<th>LABEL_ACTIVE</th>
397
                                    <th>LABEL_ACTIONS</th>
398
                                  	<th>LABEL_ACTIONS</th>
398
                                </tr>
399
                                </tr>
399
                            </thead>
400
                       		</thead>
400
                            <tbody>
401
                         	<tbody>
401
                            </tbody>
402
                         	</tbody>
402
                        </table>
403
                    	</table>
403
                    </div>
404
                   	</div>
404
                    <div class="card-footer clearfix">
405
                   	<div class="card-footer clearfix">
405
                        <div style="float:right;">
406
                   		<div style="float:right;">
406
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
407
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
407
                            <?php if ($allowAdd) : ?>
408
							<?php if($allowAdd) : ?>
408
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
409
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
409
                            <?php endif; ?>
410
							<?php endif; ?>
410
                            <?php if ($allowImport) : ?>
411
							<?php if($allowImport) : ?>
411
                                <button type="button" class="btn btn-primary btn-import"><i class="fa fa-plus"></i> LABEL_IMPORT </button>
412
							<button type="button" class="btn btn-primary btn-import"><i class="fa fa-plus"></i> LABEL_IMPORT </button>
412
                            <?php endif; ?>
413
							<?php endif; ?>
413
                        </div>
414
						</div>
414
                    </div>
415
                 	</div>
415
                </div>
416
          		</div>
416
            </div>
417
           	</div>     
417
        </div>
418
        </div>          
Línea 418... Línea 419...
418
    </div>
419
 	</div>
419
</section>
420
</section> 	
420
 
421
 
421
<!-- The Modal -->
422
<!-- The Modal -->
Línea 422... Línea 423...
422
<div class="modal" id="modal">
423
<div class="modal" id="modal">
423
    <div class="modal-dialog  modal-xl">
424
	<div class="modal-dialog  modal-xl">
424
        <div class="modal-content">
425
    	<div class="modal-content">
425
 
426
 
426
            <!-- Modal Header -->
427
            <!-- Modal Header -->
Línea 427... Línea 428...
427
            <div class="modal-header">
428
      		<div class="modal-header">
428
                <h4 class="modal-title">LABEL_BEHAVIOR - <span id="form-title"></span></h4>
-
 
429
                <button type="button" class="close" data-dismiss="modal">&times;</button>
-
 
430
            </div>
-
 
431
 
-
 
432
            <!-- Modal body -->
-
 
433
            <div class="modal-body">
-
 
434
                <?php
-
 
435
                $form = $this->form;
-
 
436
                $form->setAttributes([
-
 
437
                    'method'    => 'post',
-
 
438
                    'name'      => 'form',
-
 
439
                    'id'        => 'form'
-
 
440
                ]);
-
 
441
 
-
 
442
                $form->prepare();
-
 
443
                echo $this->form()->openTag($form);
-
 
444
                ?>
-
 
445
                <div class="form-group">
-
 
446
                    <?php
-
 
447
                    $element = $form->get('description');
-
 
448
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
-
 
449
                    $element->setAttributes(['class' => 'form-control']);
-
 
450
 
-
 
451
                    echo $this->formLabel($element);
-
 
452
                    echo $this->formTextArea($element);
-
 
453
                    ?>
-
 
454
                </div>
-
 
455
                <div class="form-group">
-
 
456
                    <?php
-
 
457
                    $element = $form->get('status');
-
 
458
                    echo $this->formCheckbox($element);
-
 
459
                    ?>
-
 
460
                </div>
-
 
461
 
-
 
462
                <div class="text-right">
-
 
463
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
464
                    <button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
-
 
465
                </div>
-
 
466
                <?php echo $this->form()->closeTag($form); ?>
-
 
467
            </div>
-
 
468
 
429
        		<h4 class="modal-title">LABEL_BEHAVIOR - <span id="form-title"></span></h4>
-
 
430
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
-
 
431
      		</div>
-
 
432
 
-
 
433
            <!-- Modal body -->
-
 
434
      		<div class="modal-body">
-
 
435
       			 <?php 
-
 
436
                    $form = $this->form;
-
 
437
            		$form->setAttributes([
-
 
438
                        'method'    => 'post',
-
 
439
                        'name'      => 'form',
-
 
440
                        'id'        => 'form'
-
 
441
                    ]);
-
 
442
    
-
 
443
                    $form->prepare();
-
 
444
                    echo $this->form()->openTag($form);
-
 
445
                    ?>					
-
 
446
    					<div class="form-group">
-
 
447
        					<?php 
-
 
448
                            $element = $form->get('description');
-
 
449
                            $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
-
 
450
                            $element->setAttributes(['class' => 'form-control']); 
-
 
451
                                            
-
 
452
                            echo $this->formLabel($element);
-
 
453
                            echo $this->formTextArea($element);
-
 
454
                            ?>
-
 
455
						</div>
-
 
456
						<div class="form-group">
-
 
457
                      	<?php 
-
 
458
                            $element = $form->get('status');
-
 
459
                            echo $this->formCheckbox($element);
-
 
460
                        ?>
-
 
461
						</div>
-
 
462
								
-
 
463
        				<div class="text-right">
-
 
464
                    		<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
465
                    		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
-
 
466
                   		</div>
-
 
467
     	      		<?php echo $this->form()->closeTag($form); ?>
-
 
468
      		</div>
-
 
469
 
-
 
470
 
-
 
471
    	</div>
-
 
472
	</div>
-
 
473
</div>