|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
ÁTICA - Aplicación web para la gestión documental de centros educativos |
|
4
|
|
|
|
|
5
|
|
|
Copyright (C) 2015-2016: Luis Ramón López López |
|
6
|
|
|
|
|
7
|
|
|
This program is free software: you can redistribute it and/or modify |
|
8
|
|
|
it under the terms of the GNU Affero General Public License as published by |
|
9
|
|
|
the Free Software Foundation, either version 3 of the License, or |
|
10
|
|
|
(at your option) any later version. |
|
11
|
|
|
|
|
12
|
|
|
This program is distributed in the hope that it will be useful, |
|
13
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15
|
|
|
GNU Affero General Public License for more details. |
|
16
|
|
|
|
|
17
|
|
|
You should have received a copy of the GNU Affero General Public License |
|
18
|
|
|
along with this program. If not, see [http://www.gnu.org/licenses/]. |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
namespace AppBundle\Controller; |
|
22
|
|
|
|
|
23
|
|
|
use AppBundle\Entity\Agreement; |
|
24
|
|
|
use AppBundle\Entity\Report; |
|
25
|
|
|
use AppBundle\Entity\Tracking; |
|
26
|
|
|
use AppBundle\Entity\Workday; |
|
27
|
|
|
use Sasedev\MpdfBundle\Service\MpdfService; |
|
28
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
|
29
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
30
|
|
|
use Symfony\Component\Translation\TranslatorInterface; |
|
31
|
|
|
|
|
32
|
|
|
class BaseController extends Controller |
|
33
|
|
|
{ |
|
34
|
|
|
protected function baseWorkdayAction(Workday $workday, Request $request, $options) |
|
35
|
|
|
{ |
|
36
|
|
|
$agreement = $workday->getAgreement(); |
|
37
|
|
|
$agreementHours = $this->getDoctrine()->getManager()->getRepository('AppBundle:Agreement')->countHours($agreement); |
|
38
|
|
|
|
|
39
|
|
|
$dow = ((6 + (int) $workday->getDate()->format('w')) % 7); |
|
40
|
|
|
|
|
41
|
|
|
$title = $this->get('translator')->trans('dow' . $dow, [], 'calendar') . ', ' . $workday->getDate()->format('d/m/Y'); |
|
42
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
43
|
|
|
$em->getRepository('AppBundle:Tracking')->updateTrackingByWorkday($workday); |
|
44
|
|
|
|
|
45
|
|
|
$form = $this->createForm('AppBundle\Form\Type\WorkdayTrackingType', $workday, [ |
|
46
|
|
|
'disabled' => (!$this->isGranted('AGREEMENT_FILL', $agreement) || $workday->isLocked()) && (!$this->isGranted('AGREEMENT_UNLOCK', $agreement)) |
|
47
|
|
|
]); |
|
48
|
|
|
$form->handleRequest($request); |
|
49
|
|
|
|
|
50
|
|
|
if ($form->isSubmitted() && $form->isValid()) { |
|
51
|
|
|
/** @var Tracking $tracking */ |
|
52
|
|
|
foreach ($workday->getTrackingActivities() as $tracking) { |
|
53
|
|
|
if ($tracking->getHours() == 0) { |
|
54
|
|
|
$workday->removeTrackingActivity($tracking); |
|
55
|
|
|
$em->remove($tracking); |
|
56
|
|
|
} else { |
|
57
|
|
|
$em->persist($tracking); |
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
$em->flush(); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
$activitiesStats = $em->getRepository('AppBundle:Agreement')->getActivitiesStats($agreement); |
|
64
|
|
|
$next = $em->getRepository('AppBundle:Workday')->getNext($workday); |
|
65
|
|
|
$previous = $em->getRepository('AppBundle:Workday')->getPrevious($workday); |
|
66
|
|
|
|
|
67
|
|
|
return $this->render('student/tracking_form.html.twig', |
|
68
|
|
|
[ |
|
69
|
|
|
'menu_item' => $options['menu_item'], |
|
70
|
|
|
'breadcrumb' => $options['breadcrumb'], |
|
71
|
|
|
'title' => $title, |
|
72
|
|
|
'user' => $this->getUser(), |
|
73
|
|
|
'workday' => $workday, |
|
74
|
|
|
'form' => $form->createView(), |
|
75
|
|
|
'agreement_hours' => $agreementHours, |
|
76
|
|
|
'activities_stats' => $activitiesStats, |
|
77
|
|
|
'next' => $next, |
|
78
|
|
|
'previous' => $previous, |
|
79
|
|
|
'back_route_name' => $options['back_route_name'] |
|
80
|
|
|
]); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
protected function lockWorkdayAction(Agreement $agreement, Request $request, $status, $routeName) |
|
84
|
|
|
{ |
|
85
|
|
|
$this->denyAccessUnlessGranted($status ? 'AGREEMENT_LOCK' : 'AGREEMENT_UNLOCK', $agreement); |
|
86
|
|
|
|
|
87
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
88
|
|
|
|
|
89
|
|
|
if ($request->request->has('ids')) { |
|
90
|
|
|
try { |
|
91
|
|
|
$ids = $request->request->get('ids'); |
|
92
|
|
|
|
|
93
|
|
|
$em->createQuery('UPDATE AppBundle:Workday w SET w.locked = :locked WHERE w.id IN (:ids) AND w.agreement = :agreement') |
|
94
|
|
|
->setParameter('locked', $status) |
|
95
|
|
|
->setParameter('ids', $ids) |
|
96
|
|
|
->setParameter('agreement', $agreement) |
|
97
|
|
|
->execute(); |
|
98
|
|
|
|
|
99
|
|
|
$em->flush(); |
|
100
|
|
|
$this->addFlash('success', $this->get('translator')->trans('alert.locked', [], 'calendar')); |
|
101
|
|
|
} catch (\Exception $e) { |
|
102
|
|
|
$this->addFlash('error', $this->get('translator')->trans('alert.locked_error', [], 'calendar')); |
|
103
|
|
|
} |
|
104
|
|
|
} |
|
105
|
|
|
return $this->redirectToRoute($routeName, ['id' => $agreement->getId()]); |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
protected function lockWeekHelper(Agreement $agreement, Request $request, $status) |
|
109
|
|
|
{ |
|
110
|
|
|
$this->denyAccessUnlessGranted($status ? 'AGREEMENT_LOCK' : 'AGREEMENT_UNLOCK', $agreement); |
|
111
|
|
|
|
|
112
|
|
|
$data = $request->get('week_lock_print', false) ?: $request->get($status ? 'week_lock' : 'week_unlock'); |
|
113
|
|
|
$week = $data % 100; |
|
114
|
|
|
$year = intdiv($data, 100); |
|
115
|
|
|
|
|
116
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
117
|
|
|
|
|
118
|
|
|
$workdays = $em->getRepository('AppBundle:Workday')->getWorkdaysInWeek($agreement, $week, $year); |
|
119
|
|
|
|
|
120
|
|
|
try { |
|
121
|
|
|
/** @var Workday $workday */ |
|
122
|
|
|
foreach ($workdays as $workday) { |
|
123
|
|
|
$workday->setLocked($status); |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
$em->flush(); |
|
127
|
|
|
$this->addFlash('success', $this->get('translator')->trans('alert.locked', [], 'calendar')); |
|
128
|
|
|
} catch (\Exception $e) { |
|
129
|
|
|
$this->addFlash('error', $this->get('translator')->trans('alert.locked_error', [], 'calendar')); |
|
130
|
|
|
} |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
protected function deleteWorkdayAction(Agreement $agreement, Request $request) |
|
134
|
|
|
{ |
|
135
|
|
|
$this->denyAccessUnlessGranted('AGREEMENT_MANAGE', $agreement); |
|
136
|
|
|
|
|
137
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
138
|
|
|
|
|
139
|
|
|
if ($request->request->has('ids')) { |
|
140
|
|
|
try { |
|
141
|
|
|
$ids = $request->request->get('ids'); |
|
142
|
|
|
|
|
143
|
|
|
$dates = $em->getRepository('AppBundle:Workday')->createQueryBuilder('w') |
|
144
|
|
|
->where('w.id IN (:ids)') |
|
145
|
|
|
->andWhere('w.agreement = :agreement') |
|
146
|
|
|
->setParameter('ids', $ids) |
|
147
|
|
|
->setParameter('agreement', $agreement) |
|
148
|
|
|
->getQuery() |
|
149
|
|
|
->getResult(); |
|
150
|
|
|
|
|
151
|
|
|
/** @var Workday $date */ |
|
152
|
|
|
foreach ($dates as $date) { |
|
153
|
|
|
if ($date->getTrackedHours() === 0.0) { |
|
154
|
|
|
$em->remove($date); |
|
155
|
|
|
} |
|
156
|
|
|
} |
|
157
|
|
|
$em->flush(); |
|
158
|
|
|
|
|
159
|
|
|
$from = $this->getDoctrine()->getManager()->getRepository('AppBundle:Agreement')->getRealFromDate($agreement); |
|
160
|
|
|
$to = $this->getDoctrine()->getManager()->getRepository('AppBundle:Agreement')->getRealToDate($agreement); |
|
161
|
|
|
$agreement->setFromDate($from); |
|
162
|
|
|
$agreement->setToDate($to); |
|
163
|
|
|
|
|
164
|
|
|
$em->flush(); |
|
165
|
|
|
$this->addFlash('success', $this->get('translator')->trans('alert.deleted', [], 'calendar')); |
|
166
|
|
|
} catch (\Exception $e) { |
|
167
|
|
|
$this->addFlash('error', $this->get('translator')->trans('alert.not_deleted', [], 'calendar')); |
|
168
|
|
|
} |
|
169
|
|
|
} |
|
170
|
|
|
return $this->redirectToRoute('admin_group_student_calendar', ['id' => $agreement->getId()]); |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
protected function workTutorReportAction(Agreement $agreement, Request $request, $breadcrumb, $routes, $template) |
|
174
|
|
|
{ |
|
175
|
|
|
$em = $this->getDoctrine()->getManager(); |
|
176
|
|
|
if (null === $agreement->getReport()) { |
|
177
|
|
|
$report = new Report(); |
|
178
|
|
|
$report->setSignDate(new \DateTime()); |
|
179
|
|
|
$report->setAgreement($agreement); |
|
180
|
|
|
$em->persist($report); |
|
181
|
|
|
} else { |
|
182
|
|
|
$report = $agreement->getReport(); |
|
183
|
|
|
} |
|
184
|
|
|
|
|
185
|
|
|
$form = $this->createForm('AppBundle\Form\Type\ReportType', $report); |
|
186
|
|
|
$form->handleRequest($request); |
|
187
|
|
|
|
|
188
|
|
|
if ($form->isSubmitted() && $form->isValid()) { |
|
189
|
|
|
$em->flush(); |
|
190
|
|
|
if ($request->request->has('submit')) { |
|
191
|
|
|
$this->addFlash('success', $this->get('translator')->trans('alert.saved', [], 'student')); |
|
192
|
|
|
} |
|
193
|
|
|
return $this->redirectToRoute( |
|
194
|
|
|
$request->request->has('submit') ? $routes[0] : $routes[1], |
|
195
|
|
|
['id' => $agreement->getId()]); |
|
196
|
|
|
} |
|
197
|
|
|
|
|
198
|
|
|
return $this->render($template, [ |
|
199
|
|
|
'menu_item' => $this->get('app.menu_builders_chain')->getMenuItemByRouteName('my_student_index'), |
|
200
|
|
|
'breadcrumb' => $breadcrumb, |
|
201
|
|
|
'form' => $form->createView(), |
|
202
|
|
|
'agreement' => $agreement |
|
203
|
|
|
]); |
|
204
|
|
|
} |
|
205
|
|
|
|
|
206
|
|
|
/** |
|
207
|
|
|
* @param MpdfService $mpdf |
|
208
|
|
|
* @param $text |
|
209
|
|
|
* @param $x |
|
210
|
|
|
* @param $y |
|
211
|
|
|
* @param $w |
|
212
|
|
|
* @param $h |
|
213
|
|
|
* @param string $overflow |
|
214
|
|
|
* @param string $align |
|
215
|
|
|
* @param bool $escape |
|
216
|
|
|
*/ |
|
217
|
|
|
private function pdfWriteFixedPosHTML(MpdfService $mpdf, $text, $x, $y, $w, $h, $overflow = 'auto', $align = 'left', $escape = true) |
|
218
|
|
|
{ |
|
219
|
|
|
$obj = $mpdf->getMpdf(); |
|
220
|
|
|
|
|
221
|
|
|
if ($escape) { |
|
222
|
|
|
$text = nl2br(htmlentities($text)); |
|
223
|
|
|
} |
|
224
|
|
|
$obj->WriteFixedPosHTML('<div style="font-family: sans-serif; font-size: 12px; text-align: ' . $align . ';">' . $text . '</div>', $x, $y, $w, $h, $overflow); |
|
225
|
|
|
} |
|
226
|
|
|
|
|
227
|
|
|
/** |
|
228
|
|
|
* @param MpdfService $mpdf |
|
229
|
|
|
* @param TranslatorInterface $translator |
|
230
|
|
|
* @param Agreement $agreement |
|
231
|
|
|
* @param string $title |
|
232
|
|
|
*/ |
|
233
|
|
|
protected function fillWorkingTutorReport(MpdfService $mpdf, TranslatorInterface $translator, Agreement $agreement, $title) |
|
234
|
|
|
{ |
|
235
|
|
|
$obj = $mpdf->getMpdf(); |
|
236
|
|
|
$obj->SetImportUse(); |
|
237
|
|
|
$obj->SetDocTemplate('pdf/Informe_tutor_laboral_seneca_rellenable.pdf'); |
|
238
|
|
|
|
|
239
|
|
|
$obj->SetFont('DejaVuSansCondensed'); |
|
240
|
|
|
$obj->SetFontSize(9); |
|
241
|
|
|
$obj->SetTitle($title); |
|
242
|
|
|
|
|
243
|
|
|
$obj->AddPage(); |
|
244
|
|
|
$obj->WriteText(40, 40.8, (string) $agreement->getStudent()); |
|
245
|
|
|
$obj->WriteText(40, 46.6, $this->getParameter('organization.name')); |
|
246
|
|
|
$obj->WriteText(40, 53, (string) $agreement->getStudent()->getStudentGroup()->getTraining()); |
|
247
|
|
|
$obj->WriteText(179, 53, (string) $agreement->getStudent()->getStudentGroup()->getTraining()->getStage()); |
|
248
|
|
|
$obj->WriteText(40, 59.1, (string) $agreement->getWorkcenter()); |
|
249
|
|
|
$obj->WriteText(165, 59.1, (string) $agreement->getTrackedHours()); |
|
250
|
|
|
$obj->WriteText(82, 65.1, (string) $agreement->getWorkTutor()); |
|
251
|
|
|
$obj->WriteText(68, 71.5, (string) $agreement->getEducationalTutor()); |
|
252
|
|
|
|
|
253
|
|
|
$obj->WriteText(108 + $agreement->getReport()->getProfessionalCompetence() * 35.0, 137, 'X'); |
|
254
|
|
|
$obj->WriteText(108 + $agreement->getReport()->getOrganizationalCompetence() * 35.0, 143.5, 'X'); |
|
255
|
|
|
$obj->WriteText(108 + $agreement->getReport()->getRelationalCompetence() * 35.0, 149.5, 'X'); |
|
256
|
|
|
$obj->WriteText(108 + $agreement->getReport()->getContingencyResponse() * 35.0, 155.5, 'X'); |
|
257
|
|
|
|
|
258
|
|
|
$obj->WriteText(104.6, 247.6, $agreement->getReport()->getSignDate()->format('d')); |
|
259
|
|
|
$obj->WriteText(154.4, 247.6, $agreement->getReport()->getSignDate()->format('y')); |
|
260
|
|
|
$obj->WriteText(89, 275.6, (string) $agreement->getWorkTutor()); |
|
261
|
|
|
|
|
262
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $agreement->getWorkcenter()->getCity(), 61, 244.4, 38, 5, 'auto', 'center'); |
|
263
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $translator->trans('r_month' . ($agreement->getReport()->getSignDate()->format('n') - 1), [], 'calendar'), 116, 244.4, 26, 5, 'auto', 'center'); |
|
264
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $agreement->getReport()->getWorkActivities(), 18, 80, 179, 40.5, 'auto', 'justify'); |
|
265
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $agreement->getReport()->getProposedChanges(), 18, 195, 179, 43, 'auto', 'justify'); |
|
266
|
|
|
} |
|
267
|
|
|
|
|
268
|
|
|
/** |
|
269
|
|
|
* @param MpdfService $mpdf |
|
270
|
|
|
* @param TranslatorInterface $translator |
|
271
|
|
|
* @param Agreement $agreement |
|
272
|
|
|
* @param Workday[] $weekDays |
|
273
|
|
|
* @param string $title |
|
274
|
|
|
* @param boolean $isLocked |
|
275
|
|
|
* @param array $weekCounter |
|
276
|
|
|
*/ |
|
277
|
|
|
protected function fillWeeklyReport(MpdfService $mpdf, TranslatorInterface $translator, Agreement $agreement, $weekDays, $title, $isLocked, $weekCounter) |
|
278
|
|
|
{ |
|
279
|
|
|
$activities = []; |
|
280
|
|
|
$hours = []; |
|
281
|
|
|
$notes = []; |
|
282
|
|
|
$noActivity = htmlentities($translator->trans('form.no_activities', [], 'calendar')); |
|
283
|
|
|
$noWorkday = htmlentities($translator->trans('form.no_workday', [], 'calendar')); |
|
284
|
|
|
|
|
285
|
|
|
foreach($weekDays as $workDay) { |
|
286
|
|
|
$day = $workDay->getDate()->format('N'); |
|
287
|
|
|
$activities[$day] = ''; |
|
288
|
|
|
$hours[$day] = ''; |
|
289
|
|
|
|
|
290
|
|
|
foreach($workDay->getTrackingActivities() as $trackingActivity) { |
|
291
|
|
|
$activities[$day] .= '<li style="list-style-position: inside; list-style: square;">'; |
|
292
|
|
|
if ($trackingActivity->getActivity()->getCode()) { |
|
293
|
|
|
$activities[$day] .= '<b>' . htmlentities($trackingActivity->getActivity()->getCode()) . ': </b>'; |
|
294
|
|
|
} |
|
295
|
|
|
$activities[$day] .= htmlentities($trackingActivity->getActivity()->getName()) . '</li>'; |
|
296
|
|
|
$hours[$day] .= '<li style="list-style-position: inside; list-style: square;">' . $translator->transChoice('form.r_hours', $trackingActivity->getHours(), ['%hours%' => $trackingActivity->getHours()], 'calendar') . '</li>'; |
|
297
|
|
|
} |
|
298
|
|
|
|
|
299
|
|
|
if ('' === $activities[$day]) { |
|
300
|
|
|
$activities[$day] = '<i>' . $noActivity . '</i>'; |
|
301
|
|
|
} |
|
302
|
|
|
$notes[$day] = $workDay->getNotes(); |
|
303
|
|
|
} |
|
304
|
|
|
|
|
305
|
|
|
$obj = $mpdf->getMpdf(); |
|
306
|
|
|
|
|
307
|
|
|
$obj->SetImportUse(); |
|
308
|
|
|
$obj->SetDocTemplate('pdf/Ficha_semanal_alumno_seneca_rellenable.pdf'); |
|
309
|
|
|
|
|
310
|
|
|
$obj->SetTitle($title); |
|
311
|
|
|
|
|
312
|
|
|
$obj->AddPage('L'); |
|
313
|
|
|
|
|
314
|
|
|
// añadir fecha a la ficha |
|
315
|
|
|
$first = end($weekDays); |
|
316
|
|
|
$last = reset($weekDays); |
|
317
|
|
|
|
|
318
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $first->getDate()->format('j'), 54.5, 33.5, 8, 5, 'auto', 'center'); |
|
319
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $last->getDate()->format('j'), 67.5, 33.5, 10, 5, 'auto', 'center'); |
|
320
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $translator->trans('r_month' . ($last->getDate()->format('n') - 1), [], 'calendar'), 85, 33.5, 23.6, 5, 'auto', 'center'); |
|
321
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $last->getDate()->format('y'), 118.5, 33.5, 6, 5, 'auto', 'center'); |
|
322
|
|
|
|
|
323
|
|
|
// añadir números de página |
|
324
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $weekCounter['current'], 245.5, 21.9, 6, 5, 'auto', 'center'); |
|
325
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $weekCounter['total'], 254.8, 21.9, 6, 5, 'auto', 'center'); |
|
326
|
|
|
|
|
327
|
|
|
// añadir campos de la cabecera |
|
328
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getWorkcenter(), 192, 40.8, 72, 5, 'auto', 'left'); |
|
329
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $this->getParameter('organization.name'), 62.7, 40.9, 80, 5, 'auto', 'left'); |
|
330
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getEducationalTutor(), 97.5, 46.5, 46, 5, 'auto', 'left'); |
|
331
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getWorkTutor(), 198, 46.5, 66, 5, 'auto', 'left'); |
|
332
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getStudent()->getStudentGroup()->getTraining(), 172, 54, 61, 5, 'auto', 'left'); |
|
333
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getStudent()->getStudentGroup()->getTraining()->getStage(), 244, 54, 20, 5, 'auto', 'left'); |
|
334
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getStudent(), 63, 54, 80, 5, 'auto', 'left'); |
|
335
|
|
|
|
|
336
|
|
|
// añadir actividades semanales |
|
337
|
|
|
for ($n = 1; $n < 6; $n++) { |
|
338
|
|
|
if (isset($activities[$n])) { |
|
339
|
|
|
$activity = $activities[$n]; |
|
340
|
|
|
$hour = $hours[$n]; |
|
341
|
|
|
$note = $notes[$n]; |
|
342
|
|
|
} else { |
|
343
|
|
|
$activity = '<i>' . $noWorkday . '</i>'; |
|
344
|
|
|
$hour = ''; |
|
345
|
|
|
$note = ''; |
|
346
|
|
|
} |
|
347
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $activity, 58, 73.0 + ($n - 1) * 17.8, 128, 15.8, 'auto', 'left', false); |
|
348
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $hour, 189, 73.0 + ($n - 1) * 17.8, 25, 15.8, 'auto', 'left', false); |
|
349
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, $note, 217.5, 73.0 + ($n - 1) * 17.8, 46, 15.8, 'auto', 'justify', true); |
|
350
|
|
|
} |
|
351
|
|
|
|
|
352
|
|
|
// añadir pie de firmas |
|
353
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getStudent(), 68, 185.4, 53, 5, 'auto', 'left'); |
|
354
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getEducationalTutor(), 136, 186.9, 53, 5, 'auto', 'left'); |
|
355
|
|
|
$this->pdfWriteFixedPosHTML($mpdf, (string) $agreement->getWorkTutor(), 204, 184.9, 53, 5, 'auto', 'left'); |
|
356
|
|
|
|
|
357
|
|
|
// si no está bloqueada la semana, agregar la marca de agua de borrador |
|
358
|
|
|
if (!$isLocked) { |
|
359
|
|
|
$obj->SetWatermarkText($translator->trans('form.draft', [], 'calendar'), 0.1); |
|
360
|
|
|
$obj->showWatermarkText = true; |
|
361
|
|
|
$obj->watermark_font = 'DejaVuSansCondensed'; |
|
362
|
|
|
} |
|
363
|
|
|
} |
|
364
|
|
|
} |
|
365
|
|
|
|