@@ -10,7 +10,6 @@ |
||
10 | 10 | use BCRM\BackendBundle\Entity\Event\Event; |
11 | 11 | use BCRM\BackendBundle\Exception\CommandException; |
12 | 12 | use BCRM\BackendBundle\Service\Event\SendTicketMailCommand; |
13 | -use Doctrine\Common\Util\Debug; |
|
14 | 13 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
15 | 14 | use Symfony\Component\Console\Input\InputInterface; |
16 | 15 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use BCRM\BackendBundle\Service\Concierge\PayRegistrationConciergeCommand; |
13 | 13 | use BCRM\BackendBundle\Entity\PaymentRepository; |
14 | 14 | use BCRM\BackendBundle\Entity\Event\RegistrationRepository; |
15 | -use Endroid\QrCode\QrCode; |
|
16 | 15 | use LiteCQRS\Bus\CommandBus; |
17 | 16 | use LiteCQRS\Bus\EventMessageBus; |
18 | 17 | use LiteCQRS\Plugin\CRUD\Model\Commands\UpdateResourceCommand; |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use BCRM\BackendBundle\Service\Mail\SendTemplateMailCommand; |
6 | 6 | use BCRM\BackendBundle\Content\ContentReader; |
7 | 7 | use Symfony\Bridge\Twig\TwigEngine; |
8 | -use Symfony\Component\Templating\TemplateReference; |
|
9 | 8 | |
10 | 9 | class Mail |
11 | 10 | { |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | { |
52 | 52 | $message = \Swift_Message::newInstance(); |
53 | 53 | $ext = $command->format === 'text/html' ? 'html' : 'txt'; |
54 | - $tplIdentifier = 'Email/' . $command->template . '.' . $ext; |
|
54 | + $tplIdentifier = 'Email/'.$command->template.'.'.$ext; |
|
55 | 55 | $template = $this->cr->getContent($tplIdentifier); |
56 | 56 | $templateData = $command->templateData; |
57 | 57 | if ($command->image !== null) { |
58 | - $templateData['image'] = $message->embed(\Swift_Image::fromPath($command->image));; |
|
58 | + $templateData['image'] = $message->embed(\Swift_Image::fromPath($command->image)); ; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | // Subject |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $subject = $env->render($subject, $templateData); |
65 | 65 | |
66 | 66 | // Body |
67 | - $body = $this->templating->render('bcrm_content:' . $tplIdentifier, $templateData); |
|
67 | + $body = $this->templating->render('bcrm_content:'.$tplIdentifier, $templateData); |
|
68 | 68 | $message->setCharset('UTF-8'); |
69 | 69 | $message->setFrom($this->mailFromEmail, $this->mailFromName) |
70 | 70 | ->setSubject($subject) |
@@ -7,13 +7,8 @@ |
||
7 | 7 | |
8 | 8 | namespace BCRM\PrintBundle\Command; |
9 | 9 | |
10 | -use BCRM\BackendBundle\Entity\Event\Event; |
|
11 | -use BCRM\BackendBundle\Entity\Event\Registration; |
|
12 | 10 | use BCRM\BackendBundle\Entity\Event\Ticket; |
13 | -use BCRM\BackendBundle\Exception\CommandException; |
|
14 | -use BCRM\BackendBundle\Service\Event\CreateTicketCommand; |
|
15 | 11 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
16 | -use Symfony\Component\Console\Input\InputArgument; |
|
17 | 12 | use Symfony\Component\Console\Input\InputInterface; |
18 | 13 | use Symfony\Component\Console\Input\InputOption; |
19 | 14 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | $data->lastname = isset($nameParts[1]) ? $nameParts[1] : null; |
65 | 65 | $data->day = $ticket->day == Ticket::DAY_SATURDAY ? 'Sa' : 'So'; |
66 | 66 | $badge = $env->render($template, (array)$data); |
67 | - $badgeFileName = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $ticket->code; |
|
68 | - $badgeSVG = $badgeFileName . '.svg'; |
|
69 | - $badgePDF = $badgeFileName . '.pdf'; |
|
67 | + $badgeFileName = sys_get_temp_dir().DIRECTORY_SEPARATOR.$ticket->code; |
|
68 | + $badgeSVG = $badgeFileName.'.svg'; |
|
69 | + $badgePDF = $badgeFileName.'.pdf'; |
|
70 | 70 | file_put_contents($badgeSVG, $badge); |
71 | 71 | exec( |
72 | 72 | sprintf( |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | escapeshellarg($badgeSVG) |
76 | 76 | ) |
77 | 77 | ); |
78 | - $printFile = rtrim($input->getOption('output'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $ticket->code . '.pdf'; |
|
78 | + $printFile = rtrim($input->getOption('output'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$ticket->code.'.pdf'; |
|
79 | 79 | if (is_file($printFile)) { |
80 | 80 | $counter = 1; |
81 | 81 | do { |
82 | - $printFile = preg_replace('/(\.[0-9]+)*\.pdf$/', '.' . ($counter++) . '.pdf', $printFile); |
|
82 | + $printFile = preg_replace('/(\.[0-9]+)*\.pdf$/', '.'.($counter++).'.pdf', $printFile); |
|
83 | 83 | } while (is_file($printFile)); |
84 | 84 | } |
85 | 85 | copy($badgePDF, $printFile); |
@@ -13,7 +13,6 @@ discard block |
||
13 | 13 | use BCRM\BackendBundle\Entity\Event\Ticket; |
14 | 14 | use BCRM\BackendBundle\Entity\Event\TicketRepository; |
15 | 15 | use BCRM\BackendBundle\Service\Concierge\CheckinCommand; |
16 | -use BCRM\WebBundle\Content\ContentReader; |
|
17 | 16 | use BCRM\WebBundle\Exception\AccesDeniedHttpException; |
18 | 17 | use BCRM\WebBundle\Exception\BadRequestException; |
19 | 18 | use Carbon\Carbon; |
@@ -21,10 +20,7 @@ discard block |
||
21 | 20 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
22 | 21 | use Symfony\Component\HttpFoundation\RedirectResponse; |
23 | 22 | use Symfony\Component\HttpFoundation\Request; |
24 | -use Symfony\Component\HttpFoundation\Response; |
|
25 | 23 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
26 | -use Symfony\Component\Routing\RouterInterface; |
|
27 | -use Symfony\Component\Validator\Constraints\DateTime; |
|
28 | 24 | |
29 | 25 | /** |
30 | 26 | * Manages event checkins. |
@@ -12,13 +12,10 @@ discard block |
||
12 | 12 | use BCRM\BackendBundle\Entity\Event\Registration; |
13 | 13 | use BCRM\BackendBundle\Entity\Event\Ticket; |
14 | 14 | use BCRM\BackendBundle\Entity\Event\TicketRepository; |
15 | -use BCRM\BackendBundle\Service\Concierge\CheckinCommand; |
|
16 | 15 | use BCRM\BackendBundle\Service\Concierge\PayRegistrationConciergeCommand; |
17 | 16 | use BCRM\BackendBundle\Service\Event\CreateTicketCommand; |
18 | 17 | use BCRM\BackendBundle\Service\Event\RegisterCommand; |
19 | -use BCRM\WebBundle\Content\ContentReader; |
|
20 | 18 | use BCRM\WebBundle\Exception\AccesDeniedHttpException; |
21 | -use BCRM\WebBundle\Exception\BadRequestException; |
|
22 | 19 | use BCRM\WebBundle\Form\TicketType; |
23 | 20 | use Carbon\Carbon; |
24 | 21 | use LiteCQRS\Bus\CommandBus; |
@@ -29,9 +26,7 @@ discard block |
||
29 | 26 | use Symfony\Component\HttpFoundation\Response; |
30 | 27 | use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; |
31 | 28 | use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; |
32 | -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
|
33 | 29 | use Symfony\Component\Routing\RouterInterface; |
34 | -use Symfony\Component\Validator\Constraints\DateTime; |
|
35 | 30 | use Symfony\Component\Security\Core\Util\SecureRandom; |
36 | 31 | |
37 | 32 | /** |
@@ -168,7 +168,7 @@ |
||
168 | 168 | $end->setTime(23, 59, 59); |
169 | 169 | $day = $now->between($start, $end) ? Ticket::DAY_SATURDAY : Ticket::DAY_SUNDAY; |
170 | 170 | |
171 | - $tickets = array_map(function (Ticket $ticket) { |
|
171 | + $tickets = array_map(function(Ticket $ticket) { |
|
172 | 172 | return array( |
173 | 173 | 'code' => $ticket->getCode(), |
174 | 174 | 'email' => $ticket->getEmail(), |
@@ -18,7 +18,6 @@ |
||
18 | 18 | use BCRM\BackendBundle\Service\Event\UnregisterCommand; |
19 | 19 | use BCRM\WebBundle\Content\ContentReader; |
20 | 20 | use BCRM\WebBundle\Form\EventRegisterModel; |
21 | -use BCRM\WebBundle\Form\EventRegisterType; |
|
22 | 21 | use BCRM\WebBundle\Form\EventUnregisterType; |
23 | 22 | use Carbon\Carbon; |
24 | 23 | use Dothiv\Bundle\MoneyFormatBundle\Service\MoneyFormatServiceInterface; |
@@ -7,7 +7,6 @@ |
||
7 | 7 | |
8 | 8 | namespace BCRM\WebBundle\Controller; |
9 | 9 | |
10 | -use BCRM\BackendBundle\Entity\Event\Event; |
|
11 | 10 | use BCRM\BackendBundle\Entity\Event\EventRepository; |
12 | 11 | use BCRM\BackendBundle\Entity\Event\Registration; |
13 | 12 | use BCRM\BackendBundle\Entity\Event\Ticket; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected function getCheckinsPerDay(array $tickets, $day) |
125 | 125 | { |
126 | - return array_reduce($tickets, function ($count, Ticket $ticket) use ($day) { |
|
126 | + return array_reduce($tickets, function($count, Ticket $ticket) use ($day) { |
|
127 | 127 | return $count + ($ticket->getType() === Registration::TYPE_NORMAL && $ticket->isCheckedIn() && $ticket->getDay() == $day ? 1 : 0); |
128 | 128 | }, 0); |
129 | 129 | } |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | protected function getUniqueDayCheckins(array $tickets, $day, $both = false) |
141 | 141 | { |
142 | 142 | $otherDayCheckins = array_map( |
143 | - function (Ticket $ticket) { |
|
143 | + function(Ticket $ticket) { |
|
144 | 144 | return $ticket->getEmail(); |
145 | 145 | }, |
146 | - array_filter($tickets, function (Ticket $ticket) use ($day) { |
|
146 | + array_filter($tickets, function(Ticket $ticket) use ($day) { |
|
147 | 147 | return |
148 | 148 | $ticket->getType() === Registration::TYPE_NORMAL |
149 | 149 | && $ticket->isCheckedIn() |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | }) |
152 | 152 | ); |
153 | 153 | |
154 | - return array_reduce($tickets, function ($count, Ticket $ticket) use ($otherDayCheckins, $day, $both) { |
|
154 | + return array_reduce($tickets, function($count, Ticket $ticket) use ($otherDayCheckins, $day, $both) { |
|
155 | 155 | return $count + ( |
156 | 156 | $ticket->getType() === Registration::TYPE_NORMAL |
157 | 157 | && $ticket->isCheckedIn() |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | protected function getNoShows(array $tickets, $day) |
165 | 165 | { |
166 | - return array_reduce($tickets, function ($count, Ticket $ticket) use ($day) { |
|
166 | + return array_reduce($tickets, function($count, Ticket $ticket) use ($day) { |
|
167 | 167 | return $count + ( |
168 | 168 | $ticket->getType() === Registration::TYPE_NORMAL |
169 | 169 | && !$ticket->isCheckedIn() |
@@ -105,7 +105,7 @@ |
||
105 | 105 | */ |
106 | 106 | protected function toBatch(ArrayCollection $emails, $deep = true) |
107 | 107 | { |
108 | - return $emails->map(function ($email) use($deep) { |
|
108 | + return $emails->map(function($email) use($deep) { |
|
109 | 109 | return array( |
110 | 110 | 'email' => $deep ? array('email' => $email) : $email, |
111 | 111 | 'email_type' => 'html' |