Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15030 Rev 15079
Línea 941... Línea 941...
941
        return new JsonModel($data);
941
        return new JsonModel($data);
942
    }
942
    }
Línea 943... Línea 943...
943
 
943
 
944
    /**
944
    /**
945
     * Render PDF
945
     * Render PDF
946
     * @param Company $currentCompany
946
     * @param Company $company;
947
     * @param JobDescription $jobDescription
947
     * @param JobDescription $jobDescription
948
     * @return mixed
948
     * @return mixed
949
     */
949
     */
950
    public function renderPDF($currentCompany, $jobDescription)
950
    public function renderPDF($company, $jobDescription)
Línea 951... Línea 951...
951
    {
951
    {
952
 
952
 
Línea 953... Línea -...
953
        //Generate New PDF
-
 
954
        $pdf = new JobPdf();
-
 
955
 
-
 
956
        $pdf->header = '';
-
 
957
        $pdf->footer = '';
-
 
958
 
-
 
959
 
-
 
960
        if ($currentCompany) {
-
 
961
            //get company Data
-
 
962
            $companyMapper = CompanyMapper::getInstance($this->adapter);
-
 
963
            $company = $companyMapper->fetchOne($currentCompany->id);
-
 
964
 
-
 
965
            $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
-
 
966
 
-
 
967
            if( $company->header) {
-
 
968
                
-
 
969
                $filename = $target_path . DIRECTORY_SEPARATOR . $company->header;
-
 
970
                if(file_exists($filename)) {
-
 
971
                
-
 
972
                    $pdf->header =  $filename;
-
 
973
                } else {
-
 
974
                    $pdf->header =  '';
-
 
975
                }
-
 
976
            } else {
-
 
977
                $pdf->header =  '';
-
 
978
            }
-
 
979
            if( $company->footer ) {
-
 
980
                $filename = $target_path . DIRECTORY_SEPARATOR . $company->footer;
-
 
981
                if(file_exists($filename)) {
-
 
982
                    $pdf->footer =  $filename;
-
 
983
                } else {
-
 
984
                    $pdf->footer =  '';
-
 
985
                }
-
 
986
                
-
 
987
            } else {
-
 
Línea -... Línea 953...
-
 
953
        //Generate New PDF
-
 
954
        $pdf = new JobPdf();
-
 
955
 
-
 
956
 
-
 
957
        
-
 
958
        $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
988
                $pdf->footer =  '';
959
        
-
 
960
        $header = $company->header ? $target_path . DIRECTORY_SEPARATOR . $company->header : '';
-
 
961
        if(empty($header) || !file_exists($header)) {
-
 
962
            $header = $this->config['leaderslinked.images_default.company_pdf_header'];
-
 
963
        }
-
 
964
        
-
 
965
        $footer = $company->footer ? $target_path . DIRECTORY_SEPARATOR . $company->footer : '';
-
 
966
        if(empty($footer) || !file_exists($footer)) {
-
 
967
            $footer = $this->config['leaderslinked.images_default.company_pdf_footer'];
-
 
968
        }
Línea 989... Línea 969...
989
            }
969
        
Línea 990... Línea 970...
990
            
970
        $pdf->header = $header;
991
 
971
        $pdf->footer = $footer;
Línea 1030... Línea 1010...
1030
 
1010
 
Línea 1031... Línea 1011...
1031
        $jobDescriptionBoss = $jobDescriptionMapper->fetchOne($jobDescription->job_description_id_boss);
1011
        $jobDescriptionBoss = $jobDescriptionMapper->fetchOne($jobDescription->job_description_id_boss);
1032
 
1012
 
1033
        $relationship = [
1013
        $relationship = [
1034
            array(
1014
            array(
1035
                'title' => 'Depende de: ',
1015
                'title' => 'Supervisa a: ',
1036
                'content' => $subordinate ? ' ' . $subordinate : ' No aplica'
1016
                'content' => $subordinate ? ' ' . $subordinate : ' No aplica'
1037
            ),
1017
            ),
1038
            array(
1018
            array(
1039
                'title' => 'Supervisa a: ',
1019
                'title' => 'Supervisado por: ',
1040
                'content' => $jobDescriptionBoss ? ' ' . $jobDescriptionBoss->name : ' No aplica'
1020
                'content' => $jobDescriptionBoss ? ' ' . $jobDescriptionBoss->name : ' No aplica'
Línea 1041... Línea 1021...
1041
            )
1021
            )
Línea 1118... Línea 1098...
1118
        }
1098
        }
Línea 1119... Línea 1099...
1119
 
1099
 
1120
 
1100
 
-
 
1101
        return $pdf->Output();
-
 
1102
    }
1121
        return $pdf->Output();
1103