Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1290 Rev 1292
Línea 553... Línea 553...
553
                        $jobDescriptionBehaviorCompetency = $jobDescriptionBehaviorCompetencyMapper->fetchOneByBehavior($companyPerformanceEvaluationForm->job_description_id, $record->competency_id, $rows->behavior_id);
553
                        $jobDescriptionBehaviorCompetency = $jobDescriptionBehaviorCompetencyMapper->fetchOneByBehavior($companyPerformanceEvaluationForm->job_description_id, $record->competency_id, $rows->behavior_id);
Línea 554... Línea 554...
554
 
554
 
Línea 555... Línea 555...
555
                        if ($behavior && $jobDescriptionBehaviorCompetency) {
555
                        if ($behavior && $jobDescriptionBehaviorCompetency) {
556
 
-
 
557
                            array_push($behaviors, [
-
 
558
                                'id_section' => $competency->uuid,
556
 
559
                                'id_option' => $behavior->uuid,
557
                            array_push($behaviors, [
560
                                'title' => $behavior->description,
-
 
561
                                'level' => $jobDescriptionBehaviorCompetency->level,
558
                                'description' => $behavior->description,
562
                                'answer' => ''
559
                                'level' => $jobDescriptionBehaviorCompetency->level,
563
                            ]);
560
                            ]);
Línea 564... Línea 561...
564
                        }
561
                        }
565
                    }
562
                    }
566
 
-
 
567
                    array_push($competencies, [
563
 
568
                        'id_section' => $competency->uuid,
564
                    array_push($competencies, [
569
                        'title' => $competenceType->name . '  ' . $competency->name,
565
                        'title' =>$competency->name,
570
                        'text' => $competency->description,
566
                        'text' => $competency->description,
571
                        'type' => 'competency',
567
                        'type' => $competenceType->name,
572
                        'options' => $behaviors
568
                        'behaviors' => $behaviors
573
                    ]);
569
                    ]);
574
                }
570
                }
575
            }
571
            }
Línea 576... Línea 572...
576
            
572
 
577
            return $this->renderPDF($currentCompany, $companyPerformanceEvaluationForm, $competencies);
573
            return $this->renderPDF($currentCompany, $companyPerformanceEvaluationForm, $competencies);
Línea 638... Línea 634...
638
        return new JsonModel([
634
        return new JsonModel([
639
            'success' => false,
635
            'success' => false,
640
            'data' => 'ERROR_METHOD_NOT_ALLOWED'
636
            'data' => 'ERROR_METHOD_NOT_ALLOWED'
641
        ]);
637
        ]);
642
    }
638
    }
643
    
-
 
644
    
639
 
645
    /**
640
    /**
646
     * Render PDF
641
     * Render PDF
647
     * @param type $currentCompany
642
     * @param type $currentCompany
648
     * @param type $performanceEvaluation
643
     * @param type $performanceEvaluation
649
     * @return type
644
     * @return type
Línea 672... Línea 667...
672
 
667
 
673
        $pdf->AliasNbPages();
668
        $pdf->AliasNbPages();
Línea 674... Línea 669...
674
        $pdf->AddPage();
669
        $pdf->AddPage();
675
 
670
 
676
 
671
 
677
       
672
 
678
        $rows = [
673
        $rows = [
679
            array(
674
            array(
Línea 701... Línea 696...
701
                'content' => date("d/m/Y")
696
                'content' => date("d/m/Y")
702
            )
697
            )
703
        ];
698
        ];
Línea 704... Línea 699...
704
 
699
 
705
        $pdf->borderTable('EVALUACIÓN DE DESEMPEÑO', $rows);
-
 
706
        
700
        $pdf->borderTable('EVALUACIÓN DE DESEMPEÑO', $rows);
-
 
701
 
707
        
702
        //Sections 
Línea 708... Línea 703...
708
        $sections = json_decode($performanceEvaluation->content, true);
703
        $sections = json_decode($performanceEvaluation->content, true);
709
 
-
 
710
                    for ($i = 0; $i < count($sections); $i++) {
-
 
711
                        
-
 
712
                        $pdf->singleTable($sections[$i]['title'], [array('content' => $sections[$i]['text'])]);
-
 
713
                        
-
 
714
                        if($sections[$i]['type']=='multiple'){
-
 
715
                            
-
 
716
                             for ($o = 0; $o < count($sections[$i]['options']); $o++) {
-
 
717
                        
-
 
718
                        $pdf->singleOptionTable($sections[$i]['options'][$o]['title'].':', [array('content' => '')]);
-
 
Línea 719... Línea -...
719
                        
-
 
720
                       
704
 
Línea -... Línea 705...
-
 
705
        for ($i = 0; $i < count($sections); $i++) {
-
 
706
 
-
 
707
            $pdf->singleTable($sections[$i]['title'], [array('content' => $sections[$i]['text'])]);
-
 
708
 
-
 
709
            if ($sections[$i]['type'] == 'multiple') {
721
 
710
 
-
 
711
                for ($o = 0; $o < count($sections[$i]['options']); $o++) {
-
 
712
 
-
 
713
                    $pdf->singleOptionTable($sections[$i]['options'][$o]['title'] . ':', [array('content' => '')]);
-
 
714
                }
-
 
715
            }
-
 
716
        }
-
 
717
        // Competencies 
-
 
718
        if (count($competencies) != 0) {
-
 
719
 
-
 
720
            // add new page
-
 
721
 
-
 
722
            $pdf->AddPage();
-
 
723
 
-
 
724
            $competencies_header[] = array('content' => 'Indique el nivel de desempeño del evaluado en relación a sus conductas y actitudes frente a cada valor, según la clasificación siguiente:');
-
 
725
 
-
 
726
            $pdf->singleTable('Anexo de valores:', $competencies_header);
-
 
727
 
-
 
728
 
-
 
729
            // Add scale section
-
 
730
            $pdf->sectionScale();
-
 
731
 
-
 
732
            $i = 0;
-
 
733
 
-
 
734
            foreach ($competencies as $record) {
-
 
735
 
-
 
736
                $i = $i + 1;
-
 
737
 
-
 
738
                $pdf->competencyTable($i, $record);
-
 
739
 
-
 
740
                if ($i % 3 == 0 && $i < $competencies) {
Línea 722... Línea 741...
722
                    }
741
                    $pdf->AddPage();
723
                        }
742
                }
724
 
-
 
725
                    }
-
 
Línea 726... Línea 743...
726
 
743
            }