Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15032 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 15032 Rev 15079
Línea 43... Línea 43...
43
use LeadersLinked\Form\PerformanceEvaluationEvaluationSupervisorForm;
43
use LeadersLinked\Form\PerformanceEvaluationEvaluationSupervisorForm;
44
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestMapper;
44
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestMapper;
45
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestSelfMapper;
45
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestSelfMapper;
46
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestBothMapper;
46
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestBothMapper;
47
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestSupervisorMapper;
47
use LeadersLinked\Mapper\CompanyPerformanceEvaluationTestSupervisorMapper;
-
 
48
use LeadersLinked\Model\Company;
48
use LeadersLinked\Model\CompanyPerformanceEvaluationTest;
49
use LeadersLinked\Model\CompanyPerformanceEvaluationTest;
49
use LeadersLinked\Model\CompanyPerformanceEvaluationForm;
50
use LeadersLinked\Model\CompanyPerformanceEvaluationForm;
50
use LeadersLinked\Model\CompanyPerformanceEvaluationTestSelf;
51
use LeadersLinked\Model\CompanyPerformanceEvaluationTestSelf;
51
use LeadersLinked\Model\CompanyPerformanceEvaluationTestBoth;
52
use LeadersLinked\Model\CompanyPerformanceEvaluationTestBoth;
52
use LeadersLinked\Model\CompanyPerformanceEvaluationTestSupervisor;
53
use LeadersLinked\Model\CompanyPerformanceEvaluationTestSupervisor;
Línea 1277... Línea 1278...
1277
        ]);
1278
        ]);
1278
    }
1279
    }
Línea 1279... Línea 1280...
1279
 
1280
 
1280
      /**
1281
      /**
1281
     * Render PDF
1282
     * Render PDF
1282
     * @param Company $currentCompany
1283
     * @param Company $company
1283
     * @param recruitmentSelectionInterview $interviewEvaluation
1284
     * @param CompanyPerformanceEvaluationTestSelf $interviewEvaluation
1284
     * @param array $competencies
1285
     * @param array $competencies
1285
     * @return mixed
1286
     * @return mixed
1286
     */
1287
     */
-
 
1288
    public function renderSelfPDF($company, $testSelf, $competencies) 
-
 
1289
    {
Línea 1287... Línea -...
1287
    public function renderSelfPDF($currentCompany, $testSelf, $competencies) {
-
 
1288
 
-
 
Línea 1289... Línea 1290...
1289
        $currentUserPlugin = $this->plugin('currentUserPlugin');
1290
 
1290
        $currentUser = $currentUserPlugin->getUser();
1291
 
Línea 1291... Línea -...
1291
 
-
 
1292
        //Generate New PDF
-
 
1293
        $pdf = new InterviewPDF();
-
 
1294
 
-
 
1295
        $pdf->header = '';
-
 
1296
        $pdf->footer = '';
-
 
1297
 
-
 
Línea 1298... Línea 1292...
1298
        if ($currentCompany) {
1292
 
1299
            //get company Data
1293
        //Generate New PDF
1300
            $companyMapper = CompanyMapper::getInstance($this->adapter);
1294
        $pdf = new InterviewPDF();
-
 
1295
 
1301
            $company = $companyMapper->fetchOne($currentCompany->id);
1296
 
1302
 
1297
        $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
-
 
1298
        
-
 
1299
        $header = $company->header ? $target_path . DIRECTORY_SEPARATOR . $company->header : '';
-
 
1300
        if(empty($header) || !file_exists($header)) {
-
 
1301
            $header = $this->config['leaderslinked.images_default.company_pdf_header'];
-
 
1302
        }
-
 
1303
        
-
 
1304
        $footer = $company->footer ? $target_path . DIRECTORY_SEPARATOR . $company->footer : '';
-
 
1305
        if(empty($footer) || !file_exists($footer)) {
Línea 1303... Línea 1306...
1303
            $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
1306
            $footer = $this->config['leaderslinked.images_default.company_pdf_footer'];
Línea 1304... Línea 1307...
1304
 
1307
        }
1305
            $pdf->header = $company->header ? $target_path . DIRECTORY_SEPARATOR . $company->header : '';
1308
        
Línea 1513... Línea 1516...
1513
            'success' => false,
1516
            'success' => false,
1514
            'data' => 'ERROR_METHOD_NOT_ALLOWED'
1517
            'data' => 'ERROR_METHOD_NOT_ALLOWED'
1515
        ]);
1518
        ]);
1516
    }
1519
    }
Línea 1517... Línea 1520...
1517
 
1520
 
Línea 1518... Línea -...
1518
    public function renderBothPDF($currentCompany, $testBoth, $competencies) {
-
 
1519
 
-
 
Línea -... Línea 1521...
-
 
1521
    public function renderBothPDF($company, $testBoth, $competencies) {
1520
        $currentUserPlugin = $this->plugin('currentUserPlugin');
1522
 
1521
        $currentUser = $currentUserPlugin->getUser();
1523
 
Línea 1522... Línea -...
1522
 
-
 
1523
        //Generate New PDF
-
 
Línea 1524... Línea -...
1524
        $pdf = new InterviewPDF();
-
 
1525
 
-
 
1526
        $pdf->header = '';
-
 
1527
        $pdf->footer = '';
-
 
Línea 1528... Línea -...
1528
 
-
 
Línea -... Línea 1524...
-
 
1524
        
-
 
1525
        //Generate New PDF
1529
        if ($currentCompany) {
1526
        $pdf = new InterviewPDF();
-
 
1527
 
-
 
1528
 
-
 
1529
 
-
 
1530
 
1530
            //get company Data
1531
        $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
-
 
1532
 
-
 
1533
        $header = $company->header ? $target_path . DIRECTORY_SEPARATOR . $company->header : '';
1531
            $companyMapper = CompanyMapper::getInstance($this->adapter);
1534
        if(empty($header) || !file_exists($header)) {
Línea -... Línea 1535...
-
 
1535
            $header = $this->config['leaderslinked.images_default.company_pdf_header'];
-
 
1536
        }
-
 
1537
            
-
 
1538
        $footer = $company->footer ? $target_path . DIRECTORY_SEPARATOR . $company->footer : '';
1532
            $company = $companyMapper->fetchOne($currentCompany->id);
1539
        if(empty($footer) || !file_exists($footer)) {
Línea 1533... Línea 1540...
1533
 
1540
            $footer = $this->config['leaderslinked.images_default.company_pdf_footer'];
1534
            $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
1541
        }
Línea 1548... Línea 1555...
1548
        $userMapper = UserMapper::getInstance($this->adapter);
1555
        $userMapper = UserMapper::getInstance($this->adapter);
1549
        $supervisor = $userMapper->fetchOne($testBoth->supervisor_id);
1556
        $supervisor = $userMapper->fetchOne($testBoth->supervisor_id);
Línea 1550... Línea 1557...
1550
 
1557
 
1551
        switch ($testBoth->points) {
1558
        switch ($testBoth->points) {
1552
            case "0":
1559
            case "0":
1553
                $points = "Sugerir otro cargo";
1560
                $points = "N/A";
1554
                break;
1561
                break;
1555
            case "1":
1562
            case "1":
1556
                $points = "25%";
1563
                $points = "25%";
1557
                break;
1564
                break;
Línea 1746... Línea 1753...
1746
        ]);
1753
        ]);
1747
    }
1754
    }
Línea 1748... Línea 1755...
1748
 
1755
 
1749
      /**
1756
      /**
1750
     * Render PDF
1757
     * Render PDF
1751
     * @param Company $currentCompany
1758
     * @param Company $company
1752
     * @param recruitmentSelectionInterview $interviewEvaluation
1759
     * @param CompanyPerformanceEvaluationTestSelf $interviewEvaluation
1753
     * @param array $competencies
1760
     * @param array $competencies
1754
     * @return mixed
1761
     * @return mixed
1755
     */
1762
     */
1756
    public function renderSupervisorPDF($currentCompany, $testSupervisor, $competencies) {
1763
    public function renderSupervisorPDF($company, $testSupervisor, $competencies) 
1757
 
-
 
1758
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
Línea 1759... Línea 1764...
1759
        $currentUser = $currentUserPlugin->getUser();
1764
    {
1760
 
1765
 
Línea 1761... Línea 1766...
1761
        //Generate New PDF
1766
        //Generate New PDF
1762
        $pdf = new InterviewPDF();
1767
        $pdf = new InterviewPDF();
Línea 1763... Línea -...
1763
 
-
 
1764
        $pdf->header = '';
-
 
1765
        $pdf->footer = '';
-
 
1766
 
-
 
1767
        if ($currentCompany) {
-
 
1768
            //get company Data
1768
 
1769
            $companyMapper = CompanyMapper::getInstance($this->adapter);
1769
        $pdf->header = '';
1770
            $company = $companyMapper->fetchOne($currentCompany->id);
1770
        $pdf->footer = '';
-
 
1771
 
1771
 
1772
        $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
1772
            $target_path = $this->config['leaderslinked.fullpath.company'] . DIRECTORY_SEPARATOR . $company->uuid;
1773
        
-
 
1774
        $header = $company->header ? $target_path . DIRECTORY_SEPARATOR . $company->header : '';
-
 
1775
        if(empty($header) || !file_exists($header)) {
-
 
1776
            $header = $this->config['leaderslinked.images_default.company_pdf_header'];
-
 
1777
        }
-
 
1778
        
-
 
1779
        $footer = $company->footer ? $target_path . DIRECTORY_SEPARATOR . $company->footer : '';
-
 
1780
        if(empty($footer) || !file_exists($footer)) {
-
 
1781
            $footer = $this->config['leaderslinked.images_default.company_pdf_footer'];
Línea 1773... Línea 1782...
1773
 
1782
        }
Línea 1774... Línea 1783...
1774
            $pdf->header = $company->header ? $target_path . DIRECTORY_SEPARATOR . $company->header : '';
1783
        
1775
            $pdf->footer = $company->footer ? $target_path . DIRECTORY_SEPARATOR . $company->footer : '';
1784
        $pdf->header = $header;