@@ -90,7 +90,11 @@ public function createActivity(array $data): bool
9090
9191 // Send email to GEFLITST if user checked checkbox of GEFLITST
9292 if ($ activity ->getRequireGEFLITST ()) {
93- $ this ->requestGEFLITST ($ activity , $ member , $ organ );
93+ $ this ->requestFacility ('GEFLITST ' , $ activity , $ member , $ organ );
94+ }
95+
96+ if ($ activity ->getRequireZettle ()) {
97+ $ this ->requestFacility ('Zettle ' , $ activity , $ member , $ organ );
9498 }
9599
96100 return true ;
@@ -179,6 +183,7 @@ protected function saveActivityData(
179183
180184 $ activity ->setIsMyFuture (boolval ($ data ['isMyFuture ' ]));
181185 $ activity ->setRequireGEFLITST (boolval ($ data ['requireGEFLITST ' ]));
186+ $ activity ->setRequireZettle (boolval ($ data ['requireZettle ' ]));
182187
183188 // Not user provided input
184189 $ activity ->setCreator ($ user );
@@ -337,7 +342,11 @@ protected function createSignupOption(
337342 $ em ->flush ();
338343 }
339344
340- private function requestGEFLITST (
345+ /**
346+ * @psalm-param 'GEFLITST'|'Zettle' $facilityType
347+ */
348+ private function requestFacility (
349+ string $ facilityType ,
341350 ActivityModel $ activity ,
342351 MemberModel $ user ,
343352 ?OrganModel $ organ ,
@@ -346,8 +355,8 @@ private function requestGEFLITST(
346355 $ activityTitle = $ activity ->getName ()->getText ('en ' );
347356 $ activityTime = $ activity ->getBeginTime ()->format ('d-m-Y H:i ' );
348357
349- $ type = ' activity_creation_require_GEFLITST ' ;
350- $ view = 'email/activity_created_require_GEFLITST ' ;
358+ $ type = sprintf ( ' activity_creation_require_%s ' , $ facilityType ) ;
359+ $ view = sprintf ( 'email/activity_created_require_%s ' , $ facilityType ) ;
351360
352361 if (null !== $ organ ) {
353362 $ subject = sprintf ('%s: %s on %s ' , $ organ ->getAbbr (), $ activityTitle , $ activityTime );
@@ -526,7 +535,13 @@ protected function isUpdateProposalNew(
526535 // HTML forms do not know anything about booleans, hence we need to
527536 // convert the strings to something we can use.
528537 array_walk_recursive ($ proposal , static function (&$ v , $ k ): void {
529- if (!in_array ($ k , ['isMyFuture ' , 'requireGEFLITST ' , 'onlyGEWIS ' , 'displaySubscribedNumber ' ], true )) {
538+ if (
539+ !in_array (
540+ $ k ,
541+ ['isMyFuture ' , 'requireGEFLITST ' , 'requireZettle ' , 'onlyGEWIS ' , 'displaySubscribedNumber ' ],
542+ true ,
543+ )
544+ ) {
530545 return ;
531546 }
532547
0 commit comments