@@ -40,6 +40,6 @@ |
||
40 | 40 | $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
41 | 41 | $factor = floor((strlen($bytes) - 1) / 3); |
42 | 42 | |
43 | - return sprintf("%.{$precision}f", $bytes / (1024 ** $factor)).@$size[$factor]; |
|
43 | + return sprintf("%.{$precision}f", $bytes / (1024 ** $factor)) . @$size[$factor]; |
|
44 | 44 | } |
45 | 45 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | private function addFiles(PaymentOrder $paymentOrder): void |
132 | 132 | { |
133 | - $source_file = realpath(__DIR__.'/../../tests/data/form/upload.pdf'); |
|
133 | + $source_file = realpath(__DIR__ . '/../../tests/data/form/upload.pdf'); |
|
134 | 134 | //We have to create a copy of our source, or the file will be deleted when the files are uploaded... |
135 | 135 | $target_file = tempnam(sys_get_temp_dir(), 'stura'); |
136 | 136 | copy($source_file, $target_file); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | //Do the same thing for References |
142 | 142 | |
143 | - $source_file = realpath(__DIR__.'/../../tests/data/form/upload.pdf'); |
|
143 | + $source_file = realpath(__DIR__ . '/../../tests/data/form/upload.pdf'); |
|
144 | 144 | //We have to create a copy of our source, or the file will be deleted when the files are uploaded... |
145 | 145 | $target_file = tempnam(sys_get_temp_dir(), 'stura'); |
146 | 146 | copy($source_file, $target_file); |
@@ -132,7 +132,7 @@ |
||
132 | 132 | $date = Carbon::now()->toDateTimeLocalString(); |
133 | 133 | |
134 | 134 | return '<h4>Manuelle Bestätigung</h4>' |
135 | - .'durch '.$user->getFullName().' ('.$user->getUsername().'), '.$date.'<br>' |
|
136 | - .'<b>Begründung: </b>'.$reason; |
|
135 | + .'durch ' . $user->getFullName() . ' (' . $user->getUsername() . '), ' . $date . '<br>' |
|
136 | + .'<b>Begründung: </b>' . $reason; |
|
137 | 137 | } |
138 | 138 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $pdf = new SturaPDF(); |
42 | 42 | $pdf->setAuthor('StuRa FSU Jena'); |
43 | - $pdf->setTitle('Zahlungsauftrag #'.$paymentOrder->getId()); |
|
43 | + $pdf->setTitle('Zahlungsauftrag #' . $paymentOrder->getId()); |
|
44 | 44 | $pdf->setSubject('Zahlungsauftrag'); |
45 | 45 | $pdf->SetAutoPageBreak(false); |
46 | 46 | |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | $pdf->setY(80); |
50 | 50 | $pdf->setMargins(25, 10); |
51 | 51 | |
52 | - $pdf->writeHTML('<h1>Zahlungsauftrag '.$paymentOrder->getIDString().'</h1><br>'); |
|
52 | + $pdf->writeHTML('<h1>Zahlungsauftrag ' . $paymentOrder->getIDString() . '</h1><br>'); |
|
53 | 53 | |
54 | 54 | $this->writeRow($pdf, 'Name Auftraggeber*in', $paymentOrder->getFullName()); |
55 | 55 | $this->writeRow($pdf, 'Struktur / Organisation', $paymentOrder->getDepartment()->getName()); |
56 | 56 | $this->writeRow($pdf, 'Projektbezeichnung', $paymentOrder->getProjectName()); |
57 | - $this->writeRow($pdf, 'Betrag', $paymentOrder->getAmountString().' €'); |
|
57 | + $this->writeRow($pdf, 'Betrag', $paymentOrder->getAmountString() . ' €'); |
|
58 | 58 | $this->writeRow($pdf, 'Mittelfreigabe / Finanzantrag', !empty($paymentOrder->getFundingId()) ? $paymentOrder->getFundingId() : '<i>Nicht angegeben</i>'); |
59 | 59 | $this->writeRow($pdf, 'FSR-Kom Umbuchung', $paymentOrder->isFsrKomResolution() ? 'Ja' : 'Nein'); |
60 | 60 | $formatter = new IntlDateFormatter('de_DE', IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $this->writeRow($pdf, 'Kontoinhaber*in', $paymentOrder->getBankInfo()->getAccountOwner()); |
66 | 66 | $this->writeRow($pdf, 'Straße/Nr.', $paymentOrder->getBankInfo()->getStreet()); |
67 | - $this->writeRow($pdf, 'PLZ/Ort', $paymentOrder->getBankInfo()->getZipCode().' '.$paymentOrder->getBankInfo()->getCity()); |
|
67 | + $this->writeRow($pdf, 'PLZ/Ort', $paymentOrder->getBankInfo()->getZipCode() . ' ' . $paymentOrder->getBankInfo()->getCity()); |
|
68 | 68 | $this->writeRow($pdf, 'IBAN', $paymentOrder->getBankInfo()->getIban()); |
69 | 69 | $this->writeRow($pdf, 'BIC', $paymentOrder->getBankInfo()->getBic()); |
70 | 70 | $this->writeRow($pdf, 'Bank', $paymentOrder->getBankInfo()->getBankName()); |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | |
90 | 90 | private function addSignatureField(TCPDF $pdf, string $content, bool $ln = true, string $align = 'L'): void |
91 | 91 | { |
92 | - $pdf->writeHTML('_____________________________________________<br><small>'.$content.'</small>', $ln, false, false, false, $align); |
|
92 | + $pdf->writeHTML('_____________________________________________<br><small>' . $content . '</small>', $ln, false, false, false, $align); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | private function writeRow(TCPDF $pdf, string $property, string $value): void |
96 | 96 | { |
97 | - $pdf->MultiCell(80, 5, '<b>'.$property.':</b>', 0, 'L', 0, 0, '', '', true, 0, true); |
|
97 | + $pdf->MultiCell(80, 5, '<b>' . $property . ':</b>', 0, 'L', 0, 0, '', '', true, 0, true); |
|
98 | 98 | $pdf->MultiCell(0, 5, $value, 0, 'L', 0, 1, '', '', true, 0, true); |
99 | 99 | } |
100 | 100 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | public function Header() |
31 | 31 | { |
32 | - $image_file = dirname(__DIR__, 3).'/assets/StuRa.png'; |
|
32 | + $image_file = dirname(__DIR__, 3) . '/assets/StuRa.png'; |
|
33 | 33 | |
34 | 34 | //$image_file = 'C:\Users\janhb\Documents\Projekte\PHP\stura\assets\StuRa.png'; |
35 | 35 | |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | |
54 | 54 | $this->SetFont('helvetica', 'I', 8); |
55 | 55 | // Page number |
56 | - $this->Cell(0, 10, 'Seite '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'L'); |
|
56 | + $this->Cell(0, 10, 'Seite ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, false, 'L'); |
|
57 | 57 | |
58 | 58 | $formatter = new IntlDateFormatter('de-DE', IntlDateFormatter::SHORT, IntlDateFormatter::MEDIUM); |
59 | 59 | |
60 | - $this->Cell(0, 10, 'Erzeugt '.$formatter->format(new DateTime()), 0, false, 'R'); |
|
60 | + $this->Cell(0, 10, 'Erzeugt ' . $formatter->format(new DateTime()), 0, false, 'R'); |
|
61 | 61 | } |
62 | 62 | } |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | foreach ($filters as $filter => $value) { |
76 | 76 | if (is_array($value)) { |
77 | 77 | foreach ($value as $subfilter => $subvalue) { |
78 | - $menuItem->setQueryParameter('filters['.$filter.']['.$subfilter.']', $subvalue); |
|
78 | + $menuItem->setQueryParameter('filters[' . $filter . '][' . $subfilter . ']', $subvalue); |
|
79 | 79 | } |
80 | 80 | } else { |
81 | - $menuItem->setQueryParameter('filters['.$filter.']', $value); |
|
81 | + $menuItem->setQueryParameter('filters[' . $filter . ']', $value); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | $actions = parent::configureActions(); |
93 | 93 | |
94 | 94 | $showLog = Action::new('showLog', 'action.show_logs', 'fas fa-binoculars') |
95 | - ->displayIf(function (DBElementInterface $entity) { |
|
95 | + ->displayIf(function(DBElementInterface $entity) { |
|
96 | 96 | return $this->isGranted('ROLE_VIEW_AUDITS'); |
97 | 97 | }) |
98 | 98 | ->setCssClass('btn btn-secondary') |
99 | - ->linkToRoute('dh_auditor_show_entity_history', function (DBElementInterface $entity) { |
|
99 | + ->linkToRoute('dh_auditor_show_entity_history', function(DBElementInterface $entity) { |
|
100 | 100 | return [ |
101 | 101 | 'entity' => str_replace('\\', '-', get_class($entity)), |
102 | 102 | 'id' => $entity->getId(), |
@@ -242,8 +242,8 @@ discard block |
||
242 | 242 | yield MenuItem::linkToCrud('user.labelp', 'fas fa-user', User::class) |
243 | 243 | ->setPermission('ROLE_READ_USER'); |
244 | 244 | |
245 | - $version = $this->app_version.'-'.$this->gitVersionInfo->getGitCommitHash() ?? ''; |
|
246 | - yield MenuItem::section('Version '.$version, 'fas fa-info'); |
|
245 | + $version = $this->app_version . '-' . $this->gitVersionInfo->getGitCommitHash() ?? ''; |
|
246 | + yield MenuItem::section('Version ' . $version, 'fas fa-info'); |
|
247 | 247 | yield MenuItem::linktoRoute('dashboard.menu.audits', 'fas fa-binoculars', 'dh_auditor_list_audits') |
248 | 248 | ->setPermission('ROLE_VIEW_AUDITS'); |
249 | 249 | yield MenuItem::linktoRoute('dashboard.menu.homepage', 'fas fa-home', 'homepage'); |
@@ -261,8 +261,8 @@ discard block |
||
261 | 261 | ->addMenuItems([ |
262 | 262 | MenuItem::linktoRoute('user.settings.title', 'fas fa-user-cog', 'user_settings'), |
263 | 263 | //It is important to use LinkToUrl here. LinkToCrud will put the route name into a param, but does not change the prefix |
264 | - MenuItem::linkToUrl(Languages::getName('de', 'de').' (DE)', '', '/de/admin'), |
|
265 | - MenuItem::linkToUrl(Languages::getName('en', 'en').' (EN)', '', '/en/admin'), |
|
264 | + MenuItem::linkToUrl(Languages::getName('de', 'de') . ' (DE)', '', '/de/admin'), |
|
265 | + MenuItem::linkToUrl(Languages::getName('en', 'en') . ' (EN)', '', '/en/admin'), |
|
266 | 266 | ]); |
267 | 267 | } |
268 | 268 |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ]); |
91 | 91 | |
92 | 92 | $generateTokenAction = Action::new('generateSkipToken', 'department.action.generate_skip_token', 'fas fa-award') |
93 | - ->displayIf(function (Department $paymentOrder) { |
|
93 | + ->displayIf(function(Department $paymentOrder) { |
|
94 | 94 | return $this->isGranted('ROLE_EDIT_ORGANISATIONS'); |
95 | 95 | }) |
96 | 96 | ->setCssClass('btn btn-secondary') |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | $choices = []; |
116 | 116 | foreach (Department::ALLOWED_TYPES as $type) { |
117 | - $choices['department.type.'.$type] = $type; |
|
117 | + $choices['department.type.' . $type] = $type; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | return [ |
@@ -177,7 +177,7 @@ |
||
177 | 177 | */ |
178 | 178 | public function confirmation(?PaymentOrder $paymentOrder, Request $request, EntityManagerInterface $em): Response |
179 | 179 | { |
180 | - if($paymentOrder === null) { |
|
180 | + if ($paymentOrder === null) { |
|
181 | 181 | $this->addFlash('error', 'payment_order.can_not_be_found'); |
182 | 182 | return $this->redirectToRoute('homepage'); |
183 | 183 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | if ($payment_order->getDepartment() !== null && $payment_order->getDepartment()->getBankAccount() !== null) { |
121 | 121 | //First folder for each bank account |
122 | - $prefix = $payment_order->getDepartment()->getBankAccount()->getName() . ' [' . $payment_order->getDepartment()->getBankAccount()->getIban() .']' . '/'; |
|
122 | + $prefix = $payment_order->getDepartment()->getBankAccount()->getName() . ' [' . $payment_order->getDepartment()->getBankAccount()->getIban() . ']' . '/'; |
|
123 | 123 | |
124 | 124 | //A sub folder for each department |
125 | 125 | $prefix .= $payment_order->getDepartment()->getName() . '/'; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $project_name = mb_ereg_replace("([^\w\s\d\-_~,;\[\]\(\).])", '', $project_name); |
132 | 132 | $project_name = mb_ereg_replace("([\.]{2,})", '', $project_name); |
133 | 133 | //Format: "ZA000001 Project Name.pdf" |
134 | - $filename = $prefix.$payment_order->getIDString().' '.$project_name.'.'.$extension; |
|
134 | + $filename = $prefix . $payment_order->getIDString() . ' ' . $project_name . '.' . $extension; |
|
135 | 135 | |
136 | 136 | $data[$filename] = $path; |
137 | 137 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | return ZIPBinaryFileResponseFacade::createZIPResponseFromFiles( |
150 | 150 | $data, |
151 | - 'Belege_'.date('Y-m-d_H-i-s').'.zip'); |
|
151 | + 'Belege_' . date('Y-m-d_H-i-s') . '.zip'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | public function configureCrud(Crud $crud): Crud |
@@ -317,32 +317,32 @@ discard block |
||
317 | 317 | ]); |
318 | 318 | |
319 | 319 | $emailAction = Action::new('sendEmail', 'payment_order.action.email', 'fas fa-envelope') |
320 | - ->linkToUrl(function (PaymentOrder $paymentOrder) { |
|
320 | + ->linkToUrl(function(PaymentOrder $paymentOrder) { |
|
321 | 321 | return $this->mailToGenerator->generateContactMailLink($paymentOrder); |
322 | 322 | }) |
323 | 323 | ->setCssClass('btn btn-secondary text-dark'); |
324 | 324 | |
325 | 325 | //Hide action if no contact emails are associated with department |
326 | - $emailAction->displayIf(function (PaymentOrder $paymentOrder) { |
|
326 | + $emailAction->displayIf(function(PaymentOrder $paymentOrder) { |
|
327 | 327 | return null !== $this->mailToGenerator->generateContactMailLink($paymentOrder); |
328 | 328 | }); |
329 | 329 | |
330 | 330 | $hhv_action = Action::new('contactHHV', 'payment_order.action.contact_hhv', 'fas fa-comment-dots') |
331 | - ->linkToUrl(function (PaymentOrder $paymentOrder) { |
|
331 | + ->linkToUrl(function(PaymentOrder $paymentOrder) { |
|
332 | 332 | return $this->mailToGenerator->getHHVMailLink($paymentOrder); |
333 | 333 | }) |
334 | 334 | ->setCssClass('btn btn-secondary text-dark'); |
335 | 335 | |
336 | 336 | $resend_confirmation_action = Action::new('resendConfirmation', 'payment_order.action.resend_confirmation', 'fas fa-redo') |
337 | 337 | ->linkToCrudAction('resendConfirmationEmail') |
338 | - ->displayIf(function (PaymentOrder $paymentOrder) { |
|
338 | + ->displayIf(function(PaymentOrder $paymentOrder) { |
|
339 | 339 | return $this->isGranted('ROLE_EDIT_PAYMENT_ORDERS') && !$paymentOrder->isConfirmed(); |
340 | 340 | }) |
341 | 341 | ->setCssClass('btn btn-secondary text-dark'); |
342 | 342 | |
343 | 343 | $mathematically_correct_action = Action::new('mathematicallyCorrect', 'payment_order.action.mathematically_correct', 'fas fa-check') |
344 | 344 | ->linkToCrudAction('checkMathematicallyCorrect') |
345 | - ->displayIf(function (PaymentOrder $paymentOrder) { |
|
345 | + ->displayIf(function(PaymentOrder $paymentOrder) { |
|
346 | 346 | return $this->isGranted('ROLE_PO_MATHEMATICALLY') |
347 | 347 | && $paymentOrder->isConfirmed() |
348 | 348 | && !$paymentOrder->isMathematicallyCorrect(); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | |
352 | 352 | $factually_correct_action = Action::new('factuallyCorrect', 'payment_order.action.factually_correct', 'fas fa-check') |
353 | 353 | ->linkToCrudAction('checkFactuallyCorrect') |
354 | - ->displayIf(function (PaymentOrder $paymentOrder) { |
|
354 | + ->displayIf(function(PaymentOrder $paymentOrder) { |
|
355 | 355 | return $this->isGranted('ROLE_PO_FACTUALLY') |
356 | 356 | && $paymentOrder->isConfirmed() |
357 | 357 | && !$paymentOrder->isFactuallyCorrect() |
@@ -361,12 +361,12 @@ discard block |
||
361 | 361 | |
362 | 362 | $manual_confirmation = Action::new('manual_confirmation', 'payment_order.action.manual_confirmation', 'fas fa-exclamation-triangle') |
363 | 363 | ->setCssClass('btn btn-secondary') |
364 | - ->linkToRoute('payment_order_manual_confirm', function (PaymentOrder $paymentOrder) { |
|
364 | + ->linkToRoute('payment_order_manual_confirm', function(PaymentOrder $paymentOrder) { |
|
365 | 365 | return [ |
366 | 366 | 'id' => $paymentOrder->getId(), |
367 | 367 | ]; |
368 | 368 | }) |
369 | - ->displayIf(function (PaymentOrder $paymentOrder) { |
|
369 | + ->displayIf(function(PaymentOrder $paymentOrder) { |
|
370 | 370 | return $this->isGranted('ROLE_MANUAL_CONFIRMATION') |
371 | 371 | && !$paymentOrder->isConfirmed(); |
372 | 372 | }); |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | |
380 | 380 | $actions->disable(Crud::PAGE_NEW); |
381 | 381 | |
382 | - if(!$this->isGranted('ROLE_EDIT_PAYMENT_ORDERS')) { |
|
382 | + if (!$this->isGranted('ROLE_EDIT_PAYMENT_ORDERS')) { |
|
383 | 383 | $actions->disable('batchDelete'); |
384 | 384 | } |
385 | 385 |