Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 3842 Rev 3896
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 473... Línea 473...
473
    $('button.btn-conduct-submit').click(function(e) {
473
    $('button.btn-conduct-submit').click(function(e) {
474
        if ($("#conduct-description").val() == "") {
474
        if ($("#conduct-description").val() == "") {
475
            $.fn.showError('ERROR_ENTER_DESCRIPTION');
475
            $.fn.showError('ERROR_ENTER_DESCRIPTION');
476
            return;
476
            return;
477
        } else {
477
        } else {
478
            $("#conduct-id").val() == "" ?
478
            $("#conduct-id").val() == "" 
479
                addBehavior($("#conduct-description").val()) :
479
                ?addBehavior($("#conduct-description").val()) 
480
                editBehavior($("#conduct-id").val(), $("#conduct-description").val())
480
                :editBehavior($("#conduct-id").val(), $("#conduct-description").val())
481
            $('#modal-conduct').modal('hide');
481
            $('#modal-conduct').modal('hide');
482
            return;
482
            return;
483
        }
483
        }
484
    });
484
    });
485
    /**
485
    /**
Línea 541... Línea 541...
541
    }
541
    }
542
    /**
542
    /**
543
     * Remove behavior
543
     * Remove behavior
544
     */
544
     */
545
    const removeBehavior = (id) => {
545
    const removeBehavior = (id) => {
-
 
546
        $.ajax({
-
 
547
            'dataType': 'json',
-
 
548
            'accept': 'application/json',
-
 
549
            'method': 'delete',
-
 
550
            'url': '/settings/behaviors/delete/' + id,
-
 
551
        })
-
 
552
        .done(function(response) {
-
 
553
            if (response['success']) {
546
        behaviors = behaviors.filter((item) => item.id != id);
554
                behaviors = behaviors.filter((item) => item.id != id);
547
        renderData(behaviors);
555
                renderData(behaviors);
-
 
556
            } else {
-
 
557
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
-
 
558
            }
-
 
559
        })
548
    }
560
    }
549
    /**
561
    /**
550
     * Render Sections data
562
     * Render Sections data
551
     */
563
     */
552
    const renderData = (data) => {
564
    const renderData = (data) => {
Línea 597... Línea 609...
597
});
609
});
Línea 598... Línea 610...
598
 
610
 
599
JS;
611
JS;
600
$this->inlineScript()->captureEnd();
612
$this->inlineScript()->captureEnd();
601
?>
613
?>
602
  	
614
 
603
<!-- Content Header (Page header) -->
615
<!-- Content Header (Page header) -->
604
<section class="content-header">
616
<section class="content-header">
605
   <div class="container-fluid">
617
    <div class="container-fluid">
606
      <div class="row mb-2">
618
        <div class="row mb-2">
607
         <div class="col-sm-12">
619
            <div class="col-sm-12">
608
            <h1>LABEL_COMPETENCIES</h1>
620
                <h1>LABEL_COMPETENCIES</h1>
609
         </div>
621
            </div>
610
      </div>
622
        </div>
611
   </div>
623
    </div>
612
   <!-- /.container-fluid -->
624
    <!-- /.container-fluid -->
613
</section>
625
</section>
614
<section class="content" id="row-list">
626
<section class="content" id="row-list">
615
   <div class="container-fluid">
627
    <div class="container-fluid">
616
      <div class="row">
628
        <div class="row">
617
         <div class="col-12">
629
            <div class="col-12">
618
            <div class="card">
630
                <div class="card">
619
               <div class="card-body">
631
                    <div class="card-body">
620
                  <table id="gridTable" class="table   table-hover">
632
                        <table id="gridTable" class="table   table-hover">
621
                     <thead>
633
                            <thead>
622
                        <tr>
634
                                <tr>
623
                           <th>LABEL_TYPE</th>
635
                                    <th>LABEL_TYPE</th>
624
                           <th>LABEL_NAME</th>
636
                                    <th>LABEL_NAME</th>
625
                           <th>LABEL_ACTIVE</th>
637
                                    <th>LABEL_ACTIVE</th>
626
                           <th>LABEL_ACTIONS</th>
638
                                    <th>LABEL_ACTIONS</th>
627
                        </tr>
639
                                </tr>
628
                     </thead>
640
                            </thead>
629
                     <tbody>
641
                            <tbody>
630
                     </tbody>
642
                            </tbody>
631
                  </table>
643
                        </table>
632
               </div>
644
                    </div>
633
               <div class="card-footer clearfix">
645
                    <div class="card-footer clearfix">
634
                  <div style="float:right;">
646
                        <div style="float:right;">
635
                     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
647
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
636
                     <?php if($allowImport) : ?>
648
                            <?php if ($allowImport) : ?>
637
                     <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
649
                                <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
638
                     <?php endif; ?>
650
                            <?php endif; ?>
639
                     <?php if($allowAdd) : ?>
651
                            <?php if ($allowAdd) : ?>
640
                     <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
652
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
-
 
653
                            <?php endif; ?>
641
                     <?php endif; ?>
654
                        </div>
642
                  </div>
655
                    </div>
643
               </div>
656
                </div>
644
            </div>
657
            </div>
645
         </div>
-
 
646
      </div>
658
        </div>
647
   </div>
659
    </div>
648
</section>
660
</section>
649
<!-- The Form creation -->
661
<!-- The Form creation -->
650
<section class="content" id="row-form" style="display: none">
662
<section class="content" id="row-form" style="display: none">
651
   <div class="container-fluid">
663
    <div class="container-fluid">
652
   <div class="row">
664
        <div class="row">
653
      <div class="col-md-12 col-sm-12 col-12">
665
            <div class="col-md-12 col-sm-12 col-12">
654
         <div class="panel">
666
                <div class="panel">
655
            <div class="panel-body">
-
 
656
               <?php 
-
 
657
                  $form = $this->form;
-
 
658
                  $form->setAttributes([
-
 
659
                      'method'    => 'post',
-
 
660
                      'name'      => 'form',
-
 
661
                      'id'        => 'form'
-
 
662
                  ]);
-
 
663
                  
-
 
664
                  $form->prepare();
-
 
665
                  echo $this->form()->openTag($form);
-
 
666
                  ?>
-
 
667
               <div   class="row">
-
 
668
                  <div class="col-md-4 col-sm-12 col-12">
-
 
669
                     <div class="from-group">
-
 
670
                        <?php 
-
 
671
                           $element = $form->get('competency_type_id');
-
 
672
                           $element->setOptions(['label' => 'LABEL_TYPE']);
-
 
673
                                           
-
 
674
                           echo $this->formLabel($element);
-
 
675
                           echo $this->formSelect($element);
-
 
676
                           ?>
-
 
677
                     </div>
-
 
678
                  </div>
-
 
679
                  <div class="col-md-4 col-sm-12 col-12">
-
 
680
                     <div class="from-group">
-
 
681
                        <?php 
-
 
682
                           $element = $form->get('name');
-
 
683
                           $element->setOptions(['label' => 'LABEL_NAME']);
-
 
684
                           $element->setAttributes(['class' => 'form-control']); 
-
 
685
                                           
-
 
686
                           echo $this->formLabel($element);
-
 
687
                           echo $this->formText($element);
-
 
688
                           ?>
-
 
689
                     </div>
-
 
690
                  </div>
-
 
691
                  <div class="col-md-4 col-sm-12 col-12">
-
 
692
                     <div class="from-group">
-
 
693
                        <label>LABEL_STATUS</label>
-
 
694
                        <br />
-
 
695
                        <?php 
-
 
696
                           $element = $form->get('status');
-
 
697
                           $element->setOptions(['label' => 'LABEL_STATUS']);
-
 
698
                           // echo $this->formLabel($element);
-
 
699
                           echo $this->formCheckbox($element);
-
 
700
                           ?>
-
 
701
                     </div>
-
 
702
                  </div>
-
 
703
                  <div class="col-md-12 col-sm-12 col-12">
-
 
704
                     <div class="form-group">
667
                    <div class="panel-body">
705
                        <?php
668
                        <?php
706
                           $element = $form->get('description');
-
 
707
                           $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
669
                        $form = $this->form;
708
                           $element->setAttributes(['class' => 'form-control']); 
-
 
709
                           
670
                        $form->setAttributes([
710
                           echo $this->formLabel($element);
671
                            'method'    => 'post',
711
                           echo $this->formTextArea($element);
672
                            'name'      => 'form',
712
                           ?>
673
                            'id'        => 'form'
-
 
674
                        ]);
713
                     </div>
675
 
714
                  </div>
676
                        $form->prepare();
715
                  <?php echo $this->form()->closeTag($form); ?>
-
 
716
                  <div class="col-md-12 col-sm-12 col-12">
677
                        echo $this->form()->openTag($form);
717
                     <div class="form-group">
678
                        ?>
718
                        <div class="row">
679
                        <div class="row">
-
 
680
                            <div class="col-md-4 col-sm-12 col-12">
-
 
681
                                <div class="from-group">
-
 
682
                                    <?php
-
 
683
                                    $element = $form->get('competency_type_id');
-
 
684
                                    $element->setOptions(['label' => 'LABEL_TYPE']);
-
 
685
 
-
 
686
                                    echo $this->formLabel($element);
-
 
687
                                    echo $this->formSelect($element);
-
 
688
                                    ?>
-
 
689
                                </div>
-
 
690
                            </div>
-
 
691
                            <div class="col-md-4 col-sm-12 col-12">
-
 
692
                                <div class="from-group">
-
 
693
                                    <?php
-
 
694
                                    $element = $form->get('name');
719
                           <div class="col-md-4 col-sm-4 col-xs-12">
695
                                    $element->setOptions(['label' => 'LABEL_NAME']);
-
 
696
                                    $element->setAttributes(['class' => 'form-control']);
-
 
697
 
-
 
698
                                    echo $this->formLabel($element);
-
 
699
                                    echo $this->formText($element);
720
                              <select name="select-conduct" id="select-conduct" class="form-control">
700
                                    ?>
721
                              </select>
701
                                </div>
722
                           </div>
702
                            </div>
-
 
703
                            <div class="col-md-4 col-sm-12 col-12">
-
 
704
                                <div class="from-group">
-
 
705
                                    <label>LABEL_STATUS</label>
-
 
706
                                    <br />
-
 
707
                                    <?php
-
 
708
                                    $element = $form->get('status');
-
 
709
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
-
 
710
                                    // echo $this->formLabel($element);
-
 
711
                                    echo $this->formCheckbox($element);
-
 
712
                                    ?>
-
 
713
                                </div>
-
 
714
                            </div>
-
 
715
                            <div class="col-md-12 col-sm-12 col-12">
-
 
716
                                <div class="form-group">
-
 
717
                                    <?php
-
 
718
                                    $element = $form->get('description');
-
 
719
                                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
-
 
720
                                    $element->setAttributes(['class' => 'form-control']);
-
 
721
 
-
 
722
                                    echo $this->formLabel($element);
-
 
723
                                    echo $this->formTextArea($element);
-
 
724
                                    ?>
-
 
725
                                </div>
-
 
726
                            </div>
-
 
727
                            <?php echo $this->form()->closeTag($form); ?>
-
 
728
                            <div class="col-md-12 col-sm-12 col-12">
-
 
729
                                <div class="form-group">
-
 
730
                                    <div class="row">
-
 
731
                                        <div class="col-md-4 col-sm-4 col-xs-12">
-
 
732
                                            <select name="select-conduct" id="select-conduct" class="form-control">
-
 
733
                                            </select>
-
 
734
                                        </div>
723
                           <div class="col-md-4 col-sm-4 col-xs-12">
735
                                        <div class="col-md-4 col-sm-4 col-xs-12">
724
                              <button type="button" class="btn btn-primary" id="btn-select-conduct" data-toggle="tooltip" title="LABEL_ADD LABEL_CONDUCT">LABEL_ADD LABEL_CONDUCT</button>
736
                                            <button type="button" class="btn btn-primary" id="btn-select-conduct" data-toggle="tooltip" title="LABEL_ADD LABEL_CONDUCT">LABEL_ADD LABEL_CONDUCT</button>
725
                           </div>
737
                                        </div>
726
                           <div class="col-md-4 col-sm-4 col-xs-12 text-right">
738
                                        <div class="col-md-4 col-sm-4 col-xs-12 text-right">
-
 
739
                                            <button type="button" class="btn btn-primary" id="btn-add-conduct" data-toggle="tooltip" title="LABEL_NEWS LABEL_CONDUCT"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_NEWS LABEL_CONDUCT</button>
-
 
740
                                        </div>
-
 
741
                                    </div>
727
                              <button type="button" class="btn btn-primary" id="btn-add-conduct" data-toggle="tooltip" title="LABEL_NEWS LABEL_CONDUCT"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_NEWS LABEL_CONDUCT</button>
742
                                </div>
728
                           </div>
743
                            </div>
729
                        </div>
-
 
730
                     </div>
-
 
731
                  </div>
-
 
732
               </div>
744
                        </div>
733
               <div class="col-xs-12 col-md-12">
745
                        <div class="col-xs-12 col-md-12">
734
                  <br/>
746
                            <br />
735
                  <div class="table-responsive">
747
                            <div class="table-responsive">
736
                     <table class="table table-bordered">
748
                                <table class="table table-bordered">
737
                        <thead>
749
                                    <thead>
738
                           <tr>
750
                                        <tr>
739
                              <th style="width: 60%;">LABEL_DESCRIPTION</th>
751
                                            <th style="width: 60%;">LABEL_DESCRIPTION</th>
740
                              <th style="width: 20%;">LABEL_ACTIONS</th>
752
                                            <th style="width: 20%;">LABEL_ACTIONS</th>
741
                           </tr>
753
                                        </tr>
742
                        </thead>
754
                                    </thead>
743
                        <tbody id="rows"></tbody>
755
                                    <tbody id="rows"></tbody>
744
                     </table>
756
                                </table>
745
                  </div>
757
                            </div>
746
                  <div class="col-xs-12 col-md-12">
758
                            <div class="col-xs-12 col-md-12">
747
                     <div class="form-group">
759
                                <div class="form-group">
748
                        <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
760
                                    <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
-
 
761
                                    <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
-
 
762
                                </div>
749
                        <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
763
                            </div>
750
                     </div>
764
                        </div>
751
                  </div>
765
                    </div>
752
               </div>
766
                </div>
753
            </div>
767
            </div>
754
         </div>
-
 
755
      </div>
-
 
756
   </div>
768
        </div>
757
</section>
769
</section>
758
<!---end form--->
770
<!---end form--->
759
<!--start modal conduct-->
771
<!--start modal conduct-->
760
<div  id="modal-conduct" class="modal" tabindex="-1" role="dialog">
772
<div id="modal-conduct" class="modal" tabindex="-1" role="dialog">
761
   <div class="modal-dialog modal-lg" role="document">
773
    <div class="modal-dialog modal-lg" role="document">
762
      <form action="#" name="form-conduct" id="form-conduct">
774
        <form action="#" name="form-conduct" id="form-conduct">
763
         <input type="hidden" name="conduct-id" id="conduct-id" value="" />
775
            <input type="hidden" name="conduct-id" id="conduct-id" value="" />
764
         <input type="hidden" name="conduct-competencia" id="conduct-competencia" value="" />
776
            <input type="hidden" name="conduct-competencia" id="conduct-competencia" value="" />
765
         <div class="modal-content">
777
            <div class="modal-content">
766
            <div class="modal-header">
778
                <div class="modal-header">
767
               <h4 class="modal-title">LABEL_ADD LABEL_CONDUCT</h4>
779
                    <h4 class="modal-title">LABEL_ADD LABEL_CONDUCT</h4>
768
               <button type="button" class="close" data-dismiss="modal" aria-label="Close">
780
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
769
               <span aria-hidden="true">&times;</span>
781
                        <span aria-hidden="true">&times;</span>
770
               </button>
782
                    </button>
771
            </div>
783
                </div>
772
            <div class="modal-body">
784
                <div class="modal-body">
773
               <div class="form-group">
785
                    <div class="form-group">
774
                  <label for="conduct-name">LABEL_DESCRIPTION</label>
786
                        <label for="conduct-name">LABEL_DESCRIPTION</label>
775
                  <input type="text" name="conduct-description" id="conduct-description" class="form-control" maxlength="200" value="" />
787
                        <input type="text" name="conduct-description" id="conduct-description" class="form-control" maxlength="200" value="" />
776
               </div>
788
                    </div>
777
            </div>
789
                </div>
778
            <div class="modal-footer">
790
                <div class="modal-footer">
779
               <button type="button" class="btn btn-primary btn-conduct-submit">LABEL_SAVE</button>
791
                    <button type="button" class="btn btn-primary btn-conduct-submit">LABEL_SAVE</button>
-
 
792
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
780
               <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
793
                </div>
781
            </div>
-
 
782
         </div>
794
            </div>
783
      </form>
795
        </form>
784
   </div>
796
    </div>
785
</div>
797
</div>
786
<!---end modal conduct --->
798
<!---end modal conduct --->
787
<!--start template--->
799
<!--start template--->
788
<script id="behaviorTemplate" type="text/x-jsrender">
800
<script id="behaviorTemplate" type="text/x-jsrender">
789
   <tr>
801
    <tr>
790
       <td class="text-left">{{:description}}</td>   
802
       <td class="text-left">{{:description}}</td>   
791
       <td>
803
       <td>
792
           <button class="btn btn-default btn-edit-conduct" data-conduct="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT</button>
804
           <button class="btn btn-default btn-edit-conduct" data-conduct="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT</button>
793
           <button class="btn btn-default btn-delete-conduct" data-conduct="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE</button>   
805
           <button class="btn btn-default btn-delete-conduct" data-conduct="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE</button>