Proyectos de Subversion LeadersLinked - Backend

Rev

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

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