Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1169 Rev 1170
Línea 47... Línea 47...
47
 
47
 
Línea 48... Línea 48...
48
$status_active = JobDescription::STATUS_ACTIVE;
48
$status_active = JobDescription::STATUS_ACTIVE;
49
 
49
 
-
 
50
$this->inlineScript()->captureStart();
-
 
51
echo <<<JS
-
 
52
 
-
 
53
var competencies = [];
-
 
54
var  competencies_type = [];
-
 
55
var subordinates = [];
-
 
56
var competencies_selected = [];
50
$this->inlineScript()->captureStart();
57
var subordinates_selected = [];
51
echo <<<JS
58
 
52
jQuery(document).ready(function($) {
59
jQuery(document).ready(function($) {
53
    $.validator.setDefaults({
60
    $.validator.setDefaults({
54
        debug: true,
61
        debug: true,
Línea 293... Línea 300...
293
                $('#form').attr('action', '$routeAdd');
300
                $('#form').attr('action', '$routeAdd');
294
                $('#form #name').val('');
301
                $('#form #name').val('');
295
                $('#form #status').bootstrapToggle('on');
302
                $('#form #status').bootstrapToggle('on');
296
                CKEDITOR.instances.functions.setData('');
303
                CKEDITOR.instances.functions.setData('');
297
                CKEDITOR.instances.objectives.setData('');
304
                CKEDITOR.instances.objectives.setData('');
-
 
305
                competencies = response['data']['competencies'];
-
 
306
                competencies_type = response['data']['competency_types'];
298
                $('#tableCompetencies tbody').empty();
307
                setCompetencySelect();
299
                var s = '';
308
                var s = '';
300
                var first = true;
309
                var first = true;
301
                $.each(response['data']['competency_types'], function(index, rowCompetencyType) {
310
                $.each(response['data']['competency_types'], function(index, rowCompetencyType) {
302
                    first = true;
311
                    first = true;
303
                    $.each(response['data']['competencies'], function(index, rowCompetency) {
312
                    $.each(response['data']['competencies'], function(index, rowCompetency) {
Línea 461... Línea 470...
461
        'width': '160px',
470
        'width': '160px',
462
        'height': '40px'
471
        'height': '40px'
463
    });
472
    });
464
    CKEDITOR.replace('functions');
473
    CKEDITOR.replace('functions');
465
    CKEDITOR.replace('objectives');
474
    CKEDITOR.replace('objectives');
-
 
475
 
-
 
476
    const setCompetencySelect = () => {
-
 
477
        $.each(competencies, function(i, item) {
-
 
478
            if (filterItemById(item.competency_id).length <= 0) {
-
 
479
                var type = filterTypeById(item.competency_type_id);
-
 
480
                $('#select-competency').append($('<option>', {
-
 
481
                    value: item.competency_id,
-
 
482
                    text: `${type.name} ${item.name}`
-
 
483
                }));
-
 
484
            }
-
 
485
        });
-
 
486
    }
-
 
487
    const filterItemById = (id) => competencies_selected.filter((item) => item.competency_id == id ? item : false)[0];
-
 
488
    const filterTypeById = (id) => competencies_type.filter((item) => item.competency_type_id == id ? item : false)[0];
466
});
489
});
-
 
490
 
467
JS;
491
JS;
468
$this->inlineScript()->captureEnd();
492
$this->inlineScript()->captureEnd();
469
?>
493
?>
470
 
-
 
471
	
-
 
472
<!-- Content Header (Page header) -->
494
<!-- Content Header (Page header) -->
473
<section class="content-header">
495
<section class="content-header">
474
	<div class="container-fluid">
496
   <div class="container-fluid">
475
    	<div class="row mb-2">
497
      <div class="row mb-2">
476
        	<div class="col-sm-12">
498
         <div class="col-sm-12">
477
            	<h1>LABEL_JOBS_DESCRIPTION</h1>
499
            <h1>LABEL_JOBS_DESCRIPTION</h1>
-
 
500
         </div>
478
			</div>
501
      </div>
479
		</div>
502
   </div>
480
	</div><!-- /.container-fluid -->
503
   <!-- /.container-fluid -->
481
</section>
504
</section>
482
 
-
 
483
<section class="content">
505
<section class="content">
484
	<div class="container-fluid">
506
   <div class="container-fluid">
485
    	<div class="row">
507
      <div class="row">
486
        	<div class="col-12">
508
         <div class="col-12">
487
				<div class="card">                    
509
            <div class="card">
488
					<div class="card-body">
510
               <div class="card-body">
489
        	    		<table id="gridTable" class="table   table-hover">
511
                  <table id="gridTable" class="table   table-hover">
490
                      		<thead>
512
                     <thead>
491
        						<tr>
513
                        <tr>
492
                                	<th>LABEL_NAME</th>
514
                           <th>LABEL_NAME</th>
493
                                  	<th>LABEL_ACTIVE</th>
515
                           <th>LABEL_ACTIVE</th>
494
                                  	<th>LABEL_ACTIONS</th>
516
                           <th>LABEL_ACTIONS</th>
495
                                </tr>
517
                        </tr>
496
                       		</thead>
518
                     </thead>
497
                         	<tbody>
519
                     <tbody>
498
                         	</tbody>
520
                     </tbody>
499
                    	</table>
521
                  </table>
500
                   	</div>
522
               </div>
501
                   	<div class="card-footer clearfix">
523
               <div class="card-footer clearfix">
502
                   		<div style="float:right;">
524
                  <div style="float:right;">
503
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
525
                     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
504
							<?php if($allowAdd) : ?>
526
                     <?php if($allowAdd) : ?>
505
                            <?php if($allowImport) : ?>
527
                     <?php if($allowImport) : ?>
506
							<button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
528
                     <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
507
							<?php endif; ?>
529
                     <?php endif; ?>
508
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
530
                     <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
509
							<?php endif; ?>
531
                     <?php endif; ?>
510
						</div>
532
                  </div>
511
                 	</div>
533
               </div>
512
          		</div>
534
            </div>
513
           	</div>     
535
         </div>
514
        </div>          
536
      </div>
515
 	</div>
537
   </div>
516
</section> 	
538
</section>
517
 
-
 
518
<!-- The Modal -->
539
<!-- The Modal -->
519
<div class="modal" id="modal">
540
<div class="modal" id="modal">
520
	<div class="modal-dialog  modal-xl">
541
   <div class="modal-dialog  modal-xl">
521
    	<div class="modal-content">
542
      <div class="modal-content">
522
 
-
 
523
            <!-- Modal Header -->
543
         <!-- Modal Header -->
524
      		<div class="modal-header">
544
         <div class="modal-header">
525
        		<h4 class="modal-title">LABEL_JOB_DESCRIPTION - <span id="form-title"></span></h4>
545
            <h4 class="modal-title">LABEL_JOB_DESCRIPTION - <span id="form-title"></span></h4>
526
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
546
            <button type="button" class="close" data-dismiss="modal">&times;</button>
527
      		</div>
547
         </div>
-
 
548
         <!-- Modal body -->
-
 
549
         <div class="modal-body">
-
 
550
            <div class="card card-primary card-outline card-tabs">
-
 
551
               <div class="card-header p-0 pt-1 border-bottom-0">
-
 
552
                  <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
-
 
553
                     <li class="nav-item">
-
 
554
                        <a class="nav-link active" id="custom-tabs-general-tab" data-toggle="pill" href="#custom-tabs-general" role="tab" aria-controls="custom-tabs-general" aria-selected="true">LABEL_GENERAL</a>
-
 
555
                     </li>
-
 
556
                     <li class="nav-item">
-
 
557
                        <a class="nav-link" id="custom-tabs-compentencies-tab" data-toggle="pill" href="#custom-tabs-compentencies" role="tab" aria-controls="custom-tabs-compentencies" aria-selected="false">LABEL_COMPETENCIES</a>
-
 
558
                     </li>
-
 
559
                     <li class="nav-item">
-
 
560
                        <a class="nav-link" id="custom-tabs-subordinates-tab" data-toggle="pill" href="#custom-tabs-subordinates" role="tab" aria-controls="custom-tabs-subordinates" aria-selected="false">LABEL_SUBORDINATES</a>
-
 
561
                     </li>
-
 
562
                  </ul>
-
 
563
               </div>
-
 
564
               <div class="card-body">
-
 
565
                  <?php 
-
 
566
                     $form = $this->form;
-
 
567
                     $form->setAttributes([
-
 
568
                         'method'    => 'post',
-
 
569
                         'name'      => 'form',
-
 
570
                         'id'        => 'form'
-
 
571
                     ]);
Línea 528... Línea -...
528
                     
-
 
529
            <!-- Modal body -->
-
 
530
      		<div class="modal-body">
-
 
531
      		
-
 
532
         		<div class="card card-primary card-outline card-tabs">
-
 
533
               		<div class="card-header p-0 pt-1 border-bottom-0">
-
 
534
                    	<ul class="nav nav-tabs" id="custom-tabs" role="tablist">
-
 
535
                      		<li class="nav-item">
-
 
536
                        		<a class="nav-link active" id="custom-tabs-general-tab" data-toggle="pill" href="#custom-tabs-general" role="tab" aria-controls="custom-tabs-general" aria-selected="true">LABEL_GENERAL</a>
-
 
537
                      		</li>
-
 
538
                      		<li class="nav-item">
-
 
539
                        		<a class="nav-link" id="custom-tabs-compentencies-tab" data-toggle="pill" href="#custom-tabs-compentencies" role="tab" aria-controls="custom-tabs-compentencies" aria-selected="false">LABEL_COMPETENCIES</a>
-
 
540
                      		</li>
-
 
541
                      		<li class="nav-item">
-
 
542
                        		<a class="nav-link" id="custom-tabs-subordinates-tab" data-toggle="pill" href="#custom-tabs-subordinates" role="tab" aria-controls="custom-tabs-subordinates" aria-selected="false">LABEL_SUBORDINATES</a>
-
 
543
                      		</li>
-
 
544
 
-
 
545
                    	</ul>
-
 
546
              		</div>
-
 
547
                  	<div class="card-body">
-
 
548
   						<?php 
-
 
549
                        $form = $this->form;
-
 
550
                        $form->setAttributes([
-
 
551
                            'method'    => 'post',
-
 
552
                            'name'      => 'form',
-
 
553
                            'id'        => 'form'
-
 
554
                        ]);
-
 
555
                
572
                     
556
                        $form->prepare();
573
                     $form->prepare();
557
                        echo $this->form()->openTag($form);
574
                     echo $this->form()->openTag($form);
558
                        ?>					
575
                     ?>					
559
                    	<div class="tab-content" id="custom-tabs-three-tabContent">
576
                  <div class="tab-content" id="custom-tabs-three-tabContent">
560
                      		<div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
577
                     <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
561
                                <div class="row">
-
 
562
                                    <div class="col-md col-sm-12 col-12">
-
 
563
                                        <div class="form-group m-0">
-
 
564
                                         <?php 
-
 
565
                                         $element = $form->get('name');
-
 
566
                                         $element->setOptions(['label' => 'LABEL_NAME']);
-
 
567
                                         $element->setAttributes(['class' => 'form-control']); 
-
 
568
                                                             
-
 
569
                                         echo $this->formLabel($element);
-
 
570
                                         echo $this->formText($element);
-
 
571
                                         ?>
-
 
572
                                     </div>
-
 
573
                                    </div>
578
                        <div class="row">
574
                                    <div class="col-md col-sm-12 col-12">
-
 
575
                                        <div class="form-group m-0">
-
 
576
                                            <?php 
-
 
577
                                                $element = $form->get('job_description_id_boss');
-
 
578
                                                $element->setOptions(['label' => 'LABEL_BOSS']);
-
 
579
                                                $element->setAttributes(['class' => 'form-control']); 
-
 
580
                        
-
 
581
                                                echo $this->formLabel($element);
-
 
582
                                                echo $this->formSelect($element);
-
 
583
                                            ?>
-
 
584
                                        </div>
-
 
585
                                    </div>
-
 
586
                                    <div
-
 
587
                                        class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center"
-
 
588
                                    >
-
 
589
                                        <div class="form-group m-0">
-
 
590
                                            <label>LABEL_STATUS</label>
-
 
591
                                            <br />
-
 
592
                                            <?php 
-
 
593
                                                $element = $form->get('status');
-
 
594
                                                $element->setOptions(['label' => 'LABEL_STATUS']);
-
 
595
                                                // echo $this->formLabel($element);
-
 
596
                                                echo $this->formCheckbox($element);
-
 
597
                                            ?>
-
 
598
                                        </div>
-
 
599
                                    </div>
-
 
600
                                </div>
579
                           <div class="col-md col-sm-12 col-12">
601
                                <div class="form-group">
580
                              <div class="form-group m-0">
602
                                	<?php 
581
                                 <?php 
603
                                    $element = $form->get('objectives');
582
                                    $element = $form->get('name');
604
                                    $element->setOptions(['label' => 'LABEL_OBJECTIVES']);
583
                                    $element->setOptions(['label' => 'LABEL_NAME']);
605
                                    $element->setAttributes(['class' => 'form-control']); 
584
                                    $element->setAttributes(['class' => 'form-control']); 
606
            
585
                                                        
607
                                    echo $this->formLabel($element);
586
                                    echo $this->formLabel($element);
608
                                    echo $this->formTextArea($element);
587
                                    echo $this->formText($element);
-
 
588
                                    ?>
609
                                    ?>
589
                              </div>
-
 
590
                           </div>
610
            					</div>
591
                           <div class="col-md col-sm-12 col-12">
611
            					<div class="form-group">
592
                              <div class="form-group m-0">
612
                            		<?php 
593
                                 <?php 
613
                                    $element = $form->get('functions');
594
                                    $element = $form->get('job_description_id_boss');
614
                                    $element->setOptions(['label' => 'LABEL_FUNCTIONS']);
595
                                    $element->setOptions(['label' => 'LABEL_BOSS']);
615
                                    $element->setAttributes(['class' => 'form-control']); 
596
                                    $element->setAttributes(['class' => 'form-control']); 
616
            
597
                                    
617
                                    echo $this->formLabel($element);
598
                                    echo $this->formLabel($element);
618
                                    echo $this->formTextArea($element);
599
                                    echo $this->formSelect($element);
-
 
600
                                    ?>
-
 
601
                              </div>
-
 
602
                           </div>
-
 
603
                           <div
-
 
604
                              class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center"
-
 
605
                              >
-
 
606
                              <div class="form-group m-0">
-
 
607
                                 <label>LABEL_STATUS</label>
-
 
608
                                 <br />
-
 
609
                                 <?php 
-
 
610
                                    $element = $form->get('status');
-
 
611
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
-
 
612
                                    // echo $this->formLabel($element);
-
 
613
                                    echo $this->formCheckbox($element);
-
 
614
                                    ?>
-
 
615
                              </div>
619
                                    ?>
616
                           </div>
-
 
617
                        </div>
-
 
618
                        <div class="form-group">
-
 
619
                           <?php 
-
 
620
                              $element = $form->get('objectives');
-
 
621
                              $element->setOptions(['label' => 'LABEL_OBJECTIVES']);
620
            					</div>
622
                              $element->setAttributes(['class' => 'form-control']); 
-
 
623
                              
-
 
624
                              echo $this->formLabel($element);
-
 
625
                              echo $this->formTextArea($element);
621
            					
626
                              ?>
622
            				</div>	
-
 
623
            								
-
 
624
                    		
-
 
-
 
627
                        </div>
-
 
628
                        <div class="form-group">
-
 
629
                           <?php 
-
 
630
                              $element = $form->get('functions');
-
 
631
                              $element->setOptions(['label' => 'LABEL_FUNCTIONS']);
625
                         	
632
                              $element->setAttributes(['class' => 'form-control']); 
-
 
633
                              
-
 
634
                              echo $this->formLabel($element);
-
 
635
                              echo $this->formTextArea($element);
-
 
636
                              ?>
-
 
637
                        </div>
626
 
638
                     </div>
627
                      		<div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
-
 
-
 
639
                     <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
628
                
640
                        <div class="row">
629
                          		<table  class="table table-hover" id="tableCompetencies">
-
 
-
 
641
                           <div class="col-md-8 col-sm-8 col-xs-12">
-
 
642
                              <select name="select-competency" id="select-competency" class="form-control">
630
 
643
                              </select>
-
 
644
                           </div>
-
 
645
                           <div class="col-md-4 col-sm-4 col-xs-12">
631
                         			<tbody>
646
                              <button type="button" class="btn btn-primary" id="btn-select-competency" data-toggle="tooltip" title="LABEL_ADD LABEL_COMPETENCY">LABEL_ADD LABEL_COMPETENCY</button>
632
                         			</tbody>
-
 
633
                         			
-
 
-
 
647
                           </div>
-
 
648
                        </div>
-
 
649
                        <div class="row">
634
                         		
650
                           <div class="col-md-12 col-sm-12 col-xs-12">
635
                         		</table>		
-
 
636
                         		
-
 
637
                         		
651
                           </div>
638
                         	</div>
-
 
-
 
652
                        </div>
639
                      		
653
                     </div>
640
                      		<div class="tab-pane fade" id="custom-tabs-subordinates" role="tabpanel" aria-labelledby="custom-tabs-subordinates-tab">
654
                     <div class="tab-pane fade" id="custom-tabs-subordinates" role="tabpanel" aria-labelledby="custom-tabs-subordinates-tab">
641
                         		<table class="table table-hover"  id="tableSubordinates">
655
                        <table class="table table-hover"  id="tableSubordinates">
642
                         			<thead>
656
                           <thead>
643
                         				<tr>
657
                              <tr>
644
                         					<th>LABEL_SUBORDINATE</th>
658
                                 <th>LABEL_SUBORDINATE</th>
645
                         				</tr>	
659
                              </tr>
646
                         			</thead>
660
                           </thead>
647
                         			<tbody>
661
                           <tbody>
648
                         			</tbody>
-
 
649
                         			
-
 
650
                         		
662
                           </tbody>
651
                         		</table>
663
                        </table>
652
                      		</div>
-
 
653
 
664
                     </div>
654
                    		</div>
665
                  </div>
655
             			</div>
666
               </div>
656
             			<?php echo $this->form()->closeTag($form); ?>	
667
               <?php echo $this->form()->closeTag($form); ?>	
657
                        <!-- /.card -->
668
               <!-- /.card -->
658
                	</div>
-
 
659
 
-
 
660
                 	      			
-
 
661
       			 
669
            </div>
662
      		</div>
-
 
663
 
670
         </div>
664
            <!-- Modal footer -->
671
         <!-- Modal footer -->
665
      		<div class="modal-footer">
672
         <div class="modal-footer">
666
                <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
673
            <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
667
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
674
            <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
668
      		</div>
-
 
669
 
675
         </div>
670
    	</div>
676
      </div>
671
	</div>
677
   </div>
672
</div>   			
-