Rev 16891 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
<?php$acl = $this->viewModel()->getRoot()->getVariable('acl');$currentUser = $this->currentUserHelper();$roleName = $currentUser->getUserTypeId();$route = $this->url('engagement/setup');$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));$this->inlineScript()->captureStart();echo <<<JSjQuery( document ).ready(function( $ ) {var validator = $('#form').validate({debug: true,onclick: false,onkeyup: false,ignore: [],rules: {'daily_pulse_how_are_you_feel': {required: true,min: 0,},'daily_pulse_climate_on_your_organization': {required: true,min: 0,},'feed_survey': {required: true,min: 0,},'internal_survey': {required: true,min: 0,},},submitHandler: function(form){$.ajax({'dataType' : 'json','accept' : 'application/json','method' : 'post','url' : $('#form').attr('action'),'data' : $('#form').serialize(),}).done(function(response) {NProgress.start();if(response['success']) {$.fn.showSuccess(response['data']);} else {validator.resetForm();if(jQuery.type(response['data']) == 'string') {$.fn.showError(response['data']);} else {$.each(response['data'], function( fieldname, errors ) {$.fn.showFormErrorValidator('#form-add #' + fieldname, errors);});}}}).fail(function( jqXHR, textStatus, errorThrown) {$.fn.showError(textStatus);}).always(function() {NProgress.done();});return false;},invalidHandler: function(form, validator) {}});$('#form #daily_pulse_how_are_you_feel').inputNumberFormat({decimal: 0});$('#form #daily_pulse_climate_on_your_organization').inputNumberFormat({decimal: 0});$('#form #feed_survey').inputNumberFormat({decimal: 0});$('#form #internal_survey').inputNumberFormat({decimal: 0});});JS;$this->inlineScript()->captureEnd();?><div class="container"><div class="card"><div class="card-header"><h6 class="card-title">LABEL_ENGAGEMENT (LABEL_POINTS)</h6></div><?php$form = $this->form;$form->setAttributes(['method' => 'post','name' => 'form','id' => 'form','action' => $route,]);$form->prepare();echo $this->form()->openTag($form);?><div class="card-body"><div class="row"><div class="col-12 mt-3"><?php$element = $form->get('daily_pulse_how_are_you_feel');$element->setOptions(['label' => 'LABEL_HOW_ARE_YOU_FEEL']);$element->setAttributes(['class' => 'form-control']);echo $this->formLabel($element);echo $this->formNumber($element);?></div></div><div class="row"><div class="col-12 mt-3"><?php$element = $form->get('daily_pulse_climate_on_your_organization');$element->setOptions(['label' => 'LABEL_CLIMATE_ON_YOUR_ORGANIZATION']);$element->setAttributes(['class' => 'form-control']);echo $this->formLabel($element);echo $this->formNumber($element);?></div></div><div class="row"><div class="col-12 mt-3"><?php$element = $form->get('feed_survey');$element->setOptions(['label' => 'LABEL_FEED_SURVEY']);$element->setAttributes(['class' => 'form-control']);echo $this->formLabel($element);echo $this->formNumber($element);?></div></div><div class="row"><div class="col-12 mt-3"><?php$element = $form->get('internal_survey');$element->setOptions(['label' => 'LABEL_INTERNAL_SURVEY']);$element->setAttributes(['class' => 'form-control']);echo $this->formLabel($element);echo $this->formNumber($element);?></div></div></div><div class="card-footer text-right"><button type="submit" class="btn btn-primary">LABEL_SAVE</button></div><?php echo $this->form()->closeTag($form); ?></div></div>