Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15079 Rev 15447
Línea 1... Línea 1...
1
<?php
1
<?php
Línea 2... Línea 2...
2
 
2
 
Línea 3... Línea 3...
3
namespace LeadersLinked\Library;
3
namespace LeadersLinked\Library;
-
 
4
 
-
 
5
use Fpdf\Fpdf;
Línea 4... Línea 6...
4
 
6
use Laminas\Mvc\I18n\Translator;
-
 
7
use LeadersLinked\Model\Competency;
-
 
8
 
Línea -... Línea 9...
-
 
9
class PerformanceEvaluationPdf extends FPDF {
-
 
10
    
-
 
11
    const MAX_Y_ADD_PAGE = 240;
-
 
12
 
5
use Fpdf\Fpdf;
13
    /**
-
 
14
     * 
-
 
15
     * @var string
-
 
16
     */
-
 
17
    public $header;
-
 
18
    
6
 
19
    /**
Línea 7... Línea 20...
7
class PerformanceEvaluationPdf extends FPDF {
20
     * 
-
 
21
     * @var string
-
 
22
     */
-
 
23
    public $footer;
-
 
24
    
-
 
25
    /**
-
 
26
     * 
8
 
27
     * @var Translator
9
    public $header;
28
     */
10
    public $footer;
29
    public $translator;
11
    
30
    
12
    /**
31
    /**
Línea 42... Línea 61...
42
 
61
 
43
        $this->SetFillColor(225, 255, 255);
62
        $this->SetFillColor(225, 255, 255);
44
        $this->SetTextColor(0);
63
        $this->SetTextColor(0);
Línea 45... Línea 64...
45
        $this->SetFont('Arial', '', 9);
64
        $this->SetFont('Arial', '', 9);
46
 
-
 
47
        $this->Cell(155, 8, utf8_decode(' 1: Mínimo  2: Medio  3: Medio-Alto  4: Alto  N/A: No aplica 
65
 
48
'), 1, 'L', false);
66
        $this->Cell(155, 8, utf8_decode(' 1: Mínimo  2: Medio  3: Medio-Alto  4: Alto  N/A: No aplica '), 1, 'L', false);
Línea 49... Línea 67...
49
        $this->Ln(15);
67
        $this->Ln(15);
50
    }
68
    }
Línea 79... Línea 97...
79
            } else {
97
            } else {
Línea 80... Línea 98...
80
 
98
 
81
                $this->SetFont('Arial', '', 9);
99
                $this->SetFont('Arial', '', 9);
82
                $this->MultiCell(190, 6, utf8_decode($rs['content']), 1, 'L', false);
100
                $this->MultiCell(190, 6, utf8_decode($rs['content']), 1, 'L', false);
-
 
101
            }
-
 
102
            
-
 
103
            $y = $this->getY();
-
 
104
            if($y >= self::MAX_Y_ADD_PAGE) {
-
 
105
                $this->addPage();
83
            }
106
            }
84
        }
107
        }
-
 
108
        $this->Ln(5);
-
 
109
        
-
 
110
        $y = $this->getY();
-
 
111
        if($y >= self::MAX_Y_ADD_PAGE) {
-
 
112
            $this->addPage();
85
        $this->Ln(5);
113
        }
Línea 86... Línea 114...
86
    }
114
    }
87
 
115
 
88
    /**
116
    /**
Línea 147... Línea 175...
147
            } else {
175
            } else {
148
                if ($rs['content'] != "") {
176
                if ($rs['content'] != "") {
149
                    $this->MultiCell(190, 6, utf8_decode($rs['content']), 0, 'L', false);
177
                    $this->MultiCell(190, 6, utf8_decode($rs['content']), 0, 'L', false);
150
                }
178
                }
151
            }
179
            }
-
 
180
            
-
 
181
            $y = $this->getY();
-
 
182
            if($y >= self::MAX_Y_ADD_PAGE) {
-
 
183
                $this->addPage();
-
 
184
            }
152
        }
185
        }
153
        $this->Ln(5);
186
        $this->Ln(5);
-
 
187
        
-
 
188
        $y = $this->getY();
-
 
189
        if($y >= self::MAX_Y_ADD_PAGE) {
-
 
190
            $this->addPage();
-
 
191
        }
-
 
192
    }
-
 
193
    
-
 
194
    function evaluationTable()
-
 
195
    {
-
 
196
        
-
 
197
        // Header Table
-
 
198
        $this->SetFillColor(204, 204, 204);
-
 
199
        $this->SetDrawColor(0, 0, 0);
-
 
200
        $this->SetLineWidth(0);
-
 
201
        $this->SetFont('Arial', 'B', 9);
-
 
202
        
-
 
203
        $this->Cell(150, 6, utf8_decode('Resumen General Final'), 1, 0, 'L', true);
-
 
204
        $this->Cell(24, 6, utf8_decode('Evaluación'), 1, 0, 'L', true);
-
 
205
        $this->Cell(16, 6, '', 1, 0, 'C', true);
-
 
206
        $this->Ln();
-
 
207
        $this->SetFont('Arial', 'B', 9);
-
 
208
        $this->Cell(190, 8, utf8_decode('Comentario final'), 0, 0, 'L', false);
-
 
209
        $this->Ln();
-
 
210
        $this->SetFont('Arial', '', 9);
-
 
211
        $this->MultiCell(190, 80, utf8_decode('   '), 0, 'J', false);
-
 
212
        
-
 
213
        
-
 
214
        /*
-
 
215
        $this->Cell(160, 6, utf8_decode('Resumen General Final'), 1, 0, 'L', true);
-
 
216
        $this->Cell(30, 6, utf8_decode('Evaluación'), 1, 0, 'C', true);
-
 
217
        $this->Ln();
-
 
218
        
-
 
219
 
-
 
220
        
-
 
221
        $this->SetFillColor(225, 255, 255);
-
 
222
        $this->SetTextColor(0);
-
 
223
        $this->SetFont('Arial', 'B', 9);
-
 
224
        
-
 
225
        
-
 
226
        $this->Cell(35, 8, utf8_decode(' Escala/Niveles:'), 1, 0, 'L', false);
-
 
227
        
-
 
228
        $this->SetFillColor(225, 255, 255);
-
 
229
        $this->SetTextColor(0);
-
 
230
        $this->SetFont('Arial', '', 9);
-
 
231
        
-
 
232
        $this->Cell(125, 8, utf8_decode(' 1: Mínimo  2: Medio  3: Medio-Alto  4: Alto  N/A: No aplica '), 1, 'L', false);
-
 
233
        $this->Cell(30, 8, utf8_decode(' N/A '), 1, 0, 'C', false);
-
 
234
        $this->Ln();
-
 
235
        $this->SetFont('Arial', 'B', 9);
-
 
236
        $this->Cell(190, 8, utf8_decode('Comentario final'), 1, 0, 'L', false);
-
 
237
        $this->Ln();
-
 
238
        $this->SetFont('Arial', '', 9);
-
 
239
        $this->MultiCell(190, 80, utf8_decode('   '), 1, 'J', false);
-
 
240
        */
-
 
241
        
-
 
242
 
-
 
243
        
154
    }
244
    }
Línea 155... Línea 245...
155
 
245
 
156
    /**
246
    /**
157
     * Create Competency Table
247
     * Create Competency Table
-
 
248
     * @param int $index
158
     * @param int $index
249
     * @param array $competency_selected
-
 
250
     *  @param array $competencies
-
 
251
     * @param array $competency_types
159
     * @param array $competency
252
     * @param array $behaviors
-
 
253
     */
-
 
254
    function competencyTable($index, $competency_selected, $competencies, $competency_types, $behaviors, $last) {
-
 
255
 
160
     */
256
        /*
-
 
257
         uuid] => 64597e43-4a44-416a-9d30-f88cfbf2021a [competency_type_uuid] => dd955db7-3bd4-4408-8ef9-11fea6780a63 [behaviors] => Array ( [0] => stdClass Object ( [uuid] => 9ad8fa37-1290-4182-962a-6e29ef1d6119 [level] => 1 ) [1] => stdClass Object ( [uuid] => aedb8677-93c5-463a-9042-4f75d1fa2b86 [level] => 2 ) [2] => stdClass Object ( [uuid] => 6a8c6427-b51e-4deb-8438-5d24b25b645f [level] => 3 ) [3] => stdClass Object ( [uuid] => d0890a5f-c23e-4ca0-a3ba-ac1b15ce68b3 [level] => 4 ) ) ) stdClass Object ( [26] => stdClass Object ( [id] => 26 [competency_id_default] => [competency_type_id] => 7 [company_id] => 1 [name] => Comunicación [uuid] => 64597e43-4a44-416a-9d30-f88cfbf2021a [description] =>
-
 
258
         */
-
 
259
       
-
 
260
        $competency = []; 
-
 
261
        foreach($competencies as $competency)
-
 
262
        {
-
 
263
            if($competency_selected->uuid == $competency->uuid) {
-
 
264
                break;
-
 
265
            }
-
 
266
        }
-
 
267
        
-
 
268
        foreach($competency_types as $competency_type)
-
 
269
        {
-
 
270
            if($competency_selected->competency_type_uuid == $competency_type->uuid) {
-
 
271
                break;
-
 
272
            }
Línea -... Línea 273...
-
 
273
        }
Línea 161... Línea 274...
161
    function competencyTable($index, $competency) {
274
 
162
 
275
        
163
 
276
 
164
        // Header Table
277
        // Header Table
165
        $this->SetFillColor(255, 255, 255);
278
        $this->SetFillColor(255, 255, 255);
Línea 166... Línea 279...
166
        $this->SetDrawColor(0, 0, 0);
279
        $this->SetDrawColor(0, 0, 0);
Línea 167... Línea 280...
167
        $this->SetLineWidth(0);
280
        $this->SetLineWidth(0);
168
        $this->SetFont('Arial', 'B', 9);
281
        $this->SetFont('Arial', 'B', 9);
169
 
282
 
170
        $this->MultiCell(190, 5, $index . '- ' . utf8_decode($competency['type']) . ': ' . utf8_decode($competency['name']), 0, 'L', false);
283
        $this->MultiCell(190, 5, $index . '- ' . utf8_decode($competency_type->name) . ': ' . utf8_decode($competency->name), 0, 'L', false);
Línea 171... Línea 284...
171
 
284
 
Línea 172... Línea 285...
172
        // Body Table
285
        // Body Table
Línea 173... Línea -...
173
        $this->SetFillColor(225, 255, 255);
-
 
174
        $this->SetTextColor(0);
-
 
175
        $this->SetFont('Arial', '', 9);
-
 
176
 
-
 
177
        $this->MultiCell(190, 6, utf8_decode(strip_tags($competency['description'])), 0, 'L', false);
-
 
178
 
-
 
Línea 179... Línea 286...
179
        $this->Ln(3);
286
        $this->SetFillColor(225, 255, 255);
180
 
-
 
181
        $this->SetFillColor(204, 204, 204);
-
 
182
        $this->SetDrawColor(0, 0, 0);
287
        $this->SetTextColor(0);
183
        $this->SetLineWidth(0);
-
 
184
        $this->SetFont('Arial', 'B', 9);
288
        $this->SetFont('Arial', '', 9);
185
 
-
 
186
        $behaviors = $competency['behaviors'];
289
 
187
 
-
 
188
        if (count($behaviors) > 0) {
290
        $this->MultiCell(190, 6, utf8_decode(strip_tags($competency->description)), 0, 'L', false);
189
 
-
 
190
            $this->Cell(150, 6, utf8_decode('Conductas observables :'), 1, 0, 'L', true);
-
 
191
            $this->Cell(16, 6, 'Nivel', 1, 0, 'C', true);
-
 
Línea -... Línea 291...
-
 
291
 
-
 
292
        $this->Ln(3);
-
 
293
 
-
 
294
 
-
 
295
        $y = $this->getY();
-
 
296
        if( $y >= self::MAX_Y_ADD_PAGE) {
-
 
297
            $this->addPage();
-
 
298
            $first  = true;
-
 
299
        }
-
 
300
 
-
 
301
        if ($competency_selected->behaviors) {
-
 
302
            
-
 
303
            $first = true;
-
 
304
 
-
 
305
            
-
 
306
            $max = count($competency_selected->behaviors);
-
 
307
            for($i = 0; $i < $max; $i++) 
-
 
308
            {
-
 
309
 
-
 
310
                
-
 
311
                $competency_behavior = $competency_selected->behaviors[$i];
-
 
312
 
-
 
313
                foreach($behaviors as $behavior)
-
 
314
                {
-
 
315
                    if($competency_behavior->uuid == $behavior->uuid) {
-
 
316
                        break;
-
 
317
                    }
-
 
318
                }
-
 
319
                
-
 
320
                if($first) {
-
 
321
                    $this->SetFillColor(204, 204, 204);
-
 
322
                    $this->SetDrawColor(0, 0, 0);
-
 
323
                    $this->SetLineWidth(0);
-
 
324
                    $this->SetFont('Arial', 'B', 9);
-
 
325
                    
-
 
326
                    $this->Cell(150, 6, utf8_decode('Conductas observables :'), 1, 0, 'L', true);
-
 
327
                    $this->Cell(16, 6, 'Nivel', 1, 0, 'C', true);
192
            $this->Cell(24, 6, utf8_decode('Evaluación'), 1, 0, 'C', true);
328
                    $this->Cell(24, 6, utf8_decode('Evaluación'), 1, 0, 'C', true);
Línea 193... Línea 329...
193
            $this->Ln();
329
                    $this->Ln();
194
 
330
                    
-
 
331
                    // Body Table
195
            // Body Table
332
                    $this->SetFillColor(225, 255, 255);
Línea 196... Línea 333...
196
            $this->SetFillColor(225, 255, 255);
333
                    $this->SetTextColor(0);
Línea 197... Línea 334...
197
            $this->SetTextColor(0);
334
                    $first = false;
Línea 198... Línea 335...
198
 
335
                }
Línea 199... Línea 336...
199
 
336
                
-
 
337
                
-
 
338
                $this->SetFont('Arial', '', 8.5);
-
 
339
 
-
 
340
                $this->Cell(150, 6, utf8_decode($behavior->description), 1, 0, 'L', false);
-
 
341
                //$this->Cell(16, 6, $competency_behavior->level == '0' ? 'N/A' : $competency_behavior->level, 1, 0, 'C', false);
-
 
342
                $this->Cell(16, 6, $competency_behavior->level, 1, 0, 'C', false);
-
 
343
                $this->Cell(24, 6, '', 1, 0, 'C', false);
200
            for ($i = 0; $i < count($behaviors); $i++) {
344
 
201
 
345
                $this->Ln();
Línea 202... Línea 346...
202
                $this->SetFont('Arial', '', 8.5);
346
 
-
 
347
                $this->SetFont('Arial', 'B', 9);
-
 
348
 
-
 
349
                $this->Cell(190, 6, utf8_decode('Comentarios:'), 1, 0, 'L', false);
-
 
350
 
-
 
351
 
-
 
352
                $this->Ln();
-
 
353
                
-
 
354
                
-
 
355
                $y = $this->getY();
-
 
356
                if( ($y >= self::MAX_Y_ADD_PAGE) && ($max - 1 > $i)) {
203
 
357
                    $this->addPage();
-
 
358
                    $first  = true;
-
 
359
                }
-
 
360
            }
Línea 204... Línea 361...
204
                $this->Cell(150, 6, utf8_decode($behaviors[$i]['description']), 1, 0, 'L', false);
361
        }