Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 864 Rev 865
Línea 265... Línea 265...
265
                'data': $('#form').serialize()
265
                'data': $('#form').serialize()
266
            }).done(function(response) {
266
            }).done(function(response) {
267
                NProgress.start();
267
                NProgress.start();
268
                if (response['success']) {
268
                if (response['success']) {
269
                    $.fn.showSuccess(response['data']);
269
                    $.fn.showSuccess(response['data']);
270
                    $('#modal').modal('hide');
270
                    $('#row-forms').hide();
-
 
271
                $('#row-lists').show();
271
                    gridTable.api().ajax.reload(null, false);
272
                    gridTable.api().ajax.reload(null, false);
272
                } else {
273
                } else {
273
                    validator.resetForm();
274
                    validator.resetForm();
274
                    if (jQuery.type(response['data']) == 'string') {
275
                    if (jQuery.type(response['data']) == 'string') {
275
                        $.fn.showError(response['data']);
276
                        $.fn.showError(response['data']);
Línea 295... Línea 296...
295
        $('#form #name').val('');
296
        $('#form #name').val('');
296
        $('#form #competency_type_id').val('').trigger('change');
297
        $('#form #competency_type_id').val('').trigger('change');
297
        $('#form #status').bootstrapToggle('on');
298
        $('#form #status').bootstrapToggle('on');
298
        CKEDITOR.instances.description.setData('');
299
        CKEDITOR.instances.description.setData('');
299
        validator.resetForm();
300
        validator.resetForm();
300
        $('#modal').modal('show');
301
        $('#row-forms').show();
-
 
302
        $('#row-lists').hide();
301
        return false;
303
        return false;
302
    });
304
    });
303
    $('body').on('click', 'button.btn-edit', function(e) {
305
    $('body').on('click', 'button.btn-edit', function(e) {
304
        e.preventDefault();
306
        e.preventDefault();
305
        NProgress.start();
307
        NProgress.start();
Línea 315... Línea 317...
315
                $('#form #name').val(response['data']['name']);
317
                $('#form #name').val(response['data']['name']);
316
                $('#form #competency_type_id').val(response['data']['competency_type_id']).trigger('change');
318
                $('#form #competency_type_id').val(response['data']['competency_type_id']).trigger('change');
317
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
319
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
318
                CKEDITOR.instances.description.setData(response['data']['description']);
320
                CKEDITOR.instances.description.setData(response['data']['description']);
319
                validator.resetForm();
321
                validator.resetForm();
320
                $('#modal').modal('show');
322
                $('#row-forms').show();
-
 
323
                $('#row-lists').hide();
321
            } else {
324
            } else {
322
                $.fn.showError(response['data']);
325
                $.fn.showError(response['data']);
323
            }
326
            }
324
        }).fail(function(jqXHR, textStatus, errorThrown) {
327
        }).fail(function(jqXHR, textStatus, errorThrown) {
325
            $.fn.showError(textStatus);
328
            $.fn.showError(textStatus);
Línea 486... Línea 489...
486
			</div>
489
			</div>
487
		</div>
490
		</div>
488
	</div><!-- /.container-fluid -->
491
	</div><!-- /.container-fluid -->
489
</section>
492
</section>
Línea 490... Línea 493...
490
 
493
 
491
<section class="content">
494
<section class="content" id="row-lists">
492
	<div class="container-fluid">
495
	<div class="container-fluid">
493
    	<div class="row">
496
    	<div class="row">
494
        	<div class="col-12">
497
        	<div class="col-12">
495
				<div class="card">                    
498
				<div class="card">                    
Línea 522... Línea 525...
522
           	</div>     
525
           	</div>     
523
        </div>          
526
        </div>          
524
 	</div>
527
 	</div>
525
</section> 	
528
</section> 	
Línea 526... Línea 529...
526
 
529
 
-
 
530
<!-- The Form creation -->
527
<!-- The Modal -->
531
<section class="content" id="row-form" style="display: none">
528
<div class="modal" id="modal">
532
   <div class="container-fluid">
529
	<div class="modal-dialog  modal-xl">
533
      <div class="row">
530
    	<div class="modal-content">
-
 
531
 
534
         <div class="panel">
532
            <!-- Modal Header -->
535
            <!-- Modal Header -->
533
      		<div class="modal-header">
536
            <div class="panel-header">
534
        		<h4 class="modal-title">LABEL_COMPETENCIES - <span id="form-title"></span></h4>
-
 
535
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
537
               <h4 class="modal-title">LABEL_COMPETENCIES - <span id="form-title"></span></h4>
536
      		</div>
-
 
537
 
538
            </div>
538
            <!-- Modal body -->
539
            <!-- Modal body -->
539
      		<div class="modal-body">
540
            <div class="panel-body">
540
       			 <?php 
541
               <?php 
541
                    $form = $this->form;
542
                  $form = $this->form;
542
            		$form->setAttributes([
543
                  $form->setAttributes([
543
                        'method'    => 'post',
544
                      'method'    => 'post',
544
                        'name'      => 'form',
545
                      'name'      => 'form',
545
                        'id'        => 'form'
546
                      'id'        => 'form'
546
                    ]);
547
                  ]);
547
    
548
                  
548
                    $form->prepare();
549
                  $form->prepare();
549
                    echo $this->form()->openTag($form);
550
                  echo $this->form()->openTag($form);
550
                    ?>
551
                  ?>
551
                        <div
552
               <div
552
                            class="row"
553
                  class="row"
553
                        >
554
                  >
554
                            <div class="col-md-4 col-sm-12 col-12">
555
                  <div class="col-md-4 col-sm-12 col-12">
555
                                <div class="form-group m-0">
556
                     <div class="form-group m-0">
556
                                   <?php 
557
                        <?php 
557
                                        $element = $form->get('competency_type_id');
558
                           $element = $form->get('competency_type_id');
558
                                        $element->setOptions(['label' => 'LABEL_TYPE']);
559
                           $element->setOptions(['label' => 'LABEL_TYPE']);
559
                                                        
560
                                           
560
                                        echo $this->formLabel($element);
561
                           echo $this->formLabel($element);
561
                                        echo $this->formSelect($element);
562
                           echo $this->formSelect($element);
562
                                   ?>
563
                           ?>
563
                               </div>	
564
                     </div>
564
                            </div>
565
                  </div>
565
                            <div class="col-md-6 col-sm-12 col-12">
566
                  <div class="col-md-6 col-sm-12 col-12">
566
                                <div class="form-group m-0">
567
                     <div class="form-group m-0">
567
                                    <?php 
568
                        <?php 
568
                                        $element = $form->get('name');
569
                           $element = $form->get('name');
569
                                        $element->setOptions(['label' => 'LABEL_NAME']);
570
                           $element->setOptions(['label' => 'LABEL_NAME']);
570
                                        $element->setAttributes(['class' => 'form-control']); 
571
                           $element->setAttributes(['class' => 'form-control']); 
571
                                                        
572
                                           
572
                                        echo $this->formLabel($element);
573
                           echo $this->formLabel($element);
573
                                        echo $this->formText($element);
574
                           echo $this->formText($element);
574
                                    ?>
575
                           ?>
575
                                </div>
576
                     </div>
576
                            </div>
577
                  </div>
577
                            <div
578
                  <div
578
                                class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center"
579
                     class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center"
579
                            >
580
                     >
580
                                <div class="form-group m-0">
581
                     <div class="form-group m-0">
581
                                    <label>LABEL_STATUS</label>
582
                        <label>LABEL_STATUS</label>
582
                                    <br />
583
                        <br />
583
                                    <?php 
584
                        <?php 
584
                                        $element = $form->get('status');
585
                           $element = $form->get('status');
585
                                        $element->setOptions(['label' => 'LABEL_STATUS']);
586
                           $element->setOptions(['label' => 'LABEL_STATUS']);
586
                                        // echo $this->formLabel($element);
587
                           // echo $this->formLabel($element);
587
                                        echo $this->formCheckbox($element);
588
                           echo $this->formCheckbox($element);
588
                                    ?>
589
                           ?>
589
                                </div>
590
                     </div>
590
                            </div>
591
                  </div>
591
                        </div>
592
               </div>
592
                        <div
593
               <div
593
                            class="row"
594
                  class="row"
594
                        >
595
                  >
595
                            <div class="col-md col-sm-12 col-12">
596
                  <div class="col-md col-sm-12 col-12">
596
                                <div class="form-group">
597
                     <div class="form-group">
597
                                    <?php
598
                        <?php
598
                                        $element = $form->get('description');
599
                           $element = $form->get('description');
599
                                        $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
600
                           $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
600
                                        $element->setAttributes(['class' => 'form-control']); 
601
                           $element->setAttributes(['class' => 'form-control']); 
601
            
602
                           
602
                                        echo $this->formLabel($element);
603
                           echo $this->formLabel($element);
603
                                        echo $this->formTextArea($element);
604
                           echo $this->formTextArea($element);
604
                                    ?>
605
                           ?>
605
                                </div>
606
                     </div>
606
                            </div>
-
 
607
                            
607
                  </div>
608
                        </div>
608
               </div>
609
                        <?php echo $this->form()->closeTag($form); ?>
609
               <?php echo $this->form()->closeTag($form); ?>
610
                        <br/>
610
               <br/>
611
                <div class="row">
611
               <div class="row">
612
                    <div class="col-xs-12 col-md-12 text-right">
612
                  <div class="col-xs-12 col-md-12 text-right">
613
                        <button class="btn btn-primary" id="btn-add-conduct" data-toggle="tooltip" title="LABEL_ADD LABEL_CONDUCT"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_CONDUCT</button>
613
                     <button class="btn btn-primary" id="btn-add-conduct" data-toggle="tooltip" title="LABEL_ADD LABEL_CONDUCT"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_CONDUCT</button>
614
                    </div>
614
                  </div>
615
                </div>
615
               </div>
616
                <br />	
616
               <br />   
617
                <div class="row">
617
               <div class="row">
618
                    <div class="col-xs-12 col-md-12">
618
                  <div class="col-xs-12 col-md-12">
619
                        <div class="panel-group" id="rows"></div>
619
                     <div class="panel-group" id="rows"></div>
620
                    </div>
620
                  </div>
621
                </div>
621
               </div>
622
                    </div>
-
 
623
                 
-
 
624
                    
622
            </div>
625
            <!-- Modal footer -->
623
            <!-- Modal footer -->
626
            <div class="modal-footer">
624
            <div class="modal-footer">
627
                <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
625
               <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
-
 
626
               <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
628
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
627
            </div>
629
      		</div>
-
 
630
 
628
         </div>
631
    	</div>
629
      </div>
632
	</div>
630
   </div>
Línea 633... Línea 631...
633
</div>   	
631
</section>
634
 
632
 
635
 
633