Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6749 Rev 6849
Línea 8... Línea 8...
8
declare(strict_types=1);
8
declare(strict_types=1);
Línea 9... Línea 9...
9
 
9
 
Línea 10... Línea 10...
10
namespace LeadersLinked\Controller;
10
namespace LeadersLinked\Controller;
11
 
-
 
-
 
11
 
12
use Laminas\Db\Adapter\AdapterInterface;
12
use Laminas\Db\Adapter\AdapterInterface;
13
use LeadersLinked\Cache\CacheInterface;
13
 
14
use Laminas\Mvc\Controller\AbstractActionController;
14
use Laminas\Mvc\Controller\AbstractActionController;
15
use Laminas\Log\LoggerInterface;
15
use Laminas\Log\LoggerInterface;
16
use Laminas\View\Model\ViewModel;
16
use Laminas\View\Model\ViewModel;
Línea 37... Línea 37...
37
     */
37
     */
38
    private $adapter;
38
    private $adapter;
Línea 39... Línea 39...
39
 
39
 
40
    /**
40
    /**
41
     *
-
 
42
     * @var CacheInterface
-
 
43
     */
-
 
44
    private $cache;
-
 
45
 
-
 
46
    /**
-
 
47
     *
41
     *
48
     * @var  LoggerInterface
42
     * @var  LoggerInterface
49
     */
43
     */
Línea 50... Línea 44...
50
    private $logger;
44
    private $logger;
Línea 56... Línea 50...
56
    private $config;
50
    private $config;
Línea 57... Línea 51...
57
 
51
 
58
    /**
52
    /**
59
     *
53
     *
60
     * @param AdapterInterface $adapter
-
 
61
     * @param CacheInterface $cache
54
     * @param AdapterInterface $adapter
62
     * @param LoggerInterface $logger
55
     * @param LoggerInterface $logger
63
     * @param array $config
56
     * @param array $config
64
     */
57
     */
65
    public function __construct($adapter, $cache, $logger, $config) {
58
    public function __construct($adapter, $logger, $config) {
66
        $this->adapter = $adapter;
-
 
67
        $this->cache = $cache;
59
        $this->adapter = $adapter;
68
        $this->logger = $logger;
60
        $this->logger = $logger;
69
        $this->config = $config;
61
        $this->config = $config;
Línea 70... Línea 62...
70
    }
62
    }
Línea 405... Línea 397...
405
     * @return mixed
397
     * @return mixed
406
     */
398
     */
407
    public function renderPDF($companySelfEvaluationForm, $companySelfEvaluationTest, $userMapper) {
399
    public function renderPDF($companySelfEvaluationForm, $companySelfEvaluationTest, $userMapper) {
Línea 408... Línea 400...
408
 
400
 
409
        // Set Data
401
        // Set Data
410
        $headerFormName = utf8_decode($companySelfEvaluationForm->name);
402
        $headerFormName = Functions::utf8_decode($companySelfEvaluationForm->name);
411
        $headerUserName = utf8_decode('Informe de Auto-evaluación: ' . trim($userMapper->first_name . ' ' . $userMapper->last_name) . ' al ' . date("m-d-Y H:i:s", strtotime($companySelfEvaluationTest->added_on)));
403
        $headerUserName = Functions::utf8_decode('Informe de Auto-evaluación: ' . trim($userMapper->first_name . ' ' . $userMapper->last_name) . ' al ' . date("m-d-Y H:i:s", strtotime($companySelfEvaluationTest->added_on)));
412
        $sections = json_decode($companySelfEvaluationTest->content, true);
404
        $sections = json_decode($companySelfEvaluationTest->content, true);
Línea 413... Línea 405...
413
        $labels = ['Total', 'Logrado'];
405
        $labels = ['Total', 'Logrado'];
Línea 449... Línea 441...
449
 
441
 
450
 
442
 
451
            $filename = 'data' . DIRECTORY_SEPARATOR . 'self-evaluation' . $sections[$i]['slug_section'] . '.png';
443
            $filename = 'data' . DIRECTORY_SEPARATOR . 'self-evaluation' . $sections[$i]['slug_section'] . '.png';
452
            $pdf->PieChart($labels, $values, '', $filename);
444
            $pdf->PieChart($labels, $values, '', $filename);
453
            $pdf->SetFont('Arial', '', 8);
445
            $pdf->SetFont('Arial', '', 8);
454
            $pdf->Cell(190, 10, utf8_decode($sections[$i]['name']), 0, 0, 'C');
446
            $pdf->Cell(190, 10, Functions::utf8_decode($sections[$i]['name']), 0, 0, 'C');
455
            $pdf->setY($pdf->getY() + 10);
447
            $pdf->setY($pdf->getY() + 10);
456
            // Salto de línea
448
            // Salto de línea
Línea 462... Línea 454...
462
 
454
 
463
        $pdf->AddPage();
455
        $pdf->AddPage();
Línea 464... Línea 456...
464
        $pdf->customHeader($headerFormName, $headerUserName);
456
        $pdf->customHeader($headerFormName, $headerUserName);
465
 
457
 
466
        $pdf->SetFont('Arial', 'B', 10);
458
        $pdf->SetFont('Arial', 'B', 10);
Línea 467... Línea 459...
467
        $pdf->Cell(190, 10, utf8_decode('Desempeño General'), 0, 0, 'C');
459
        $pdf->Cell(190, 10, Functions::utf8_decode('Desempeño General'), 0, 0, 'C');
Línea 477... Línea 469...
477
 
469
 
Línea 478... Línea 470...
478
 
470
 
479
        if ($companySelfEvaluationTest->comments) {
471
        if ($companySelfEvaluationTest->comments) {
480
 
472
 
Línea 481... Línea 473...
481
            $pdf->SetFont('Arial', 'B', 10);
473
            $pdf->SetFont('Arial', 'B', 10);
482
            $pdf->Cell(190, 10, utf8_decode('Comentarios finales'), 0, 0, 'C');
474
            $pdf->Cell(190, 10, Functions::utf8_decode('Comentarios finales'), 0, 0, 'C');
483
            $pdf->setY($pdf->getY() + 10);
475
            $pdf->setY($pdf->getY() + 10);
484
 
476
 
Línea 485... Línea 477...
485
            $pdf->SetFont('Arial', '', 8);
477
            $pdf->SetFont('Arial', '', 8);
486
            $pdf->MultiCell(180, 8, utf8_decode($companySelfEvaluationTest->comments));
478
            $pdf->MultiCell(180, 8, Functions::utf8_decode($companySelfEvaluationTest->comments));