/** * action new * * @param \TYPO3\Events\Domain\Model\Event $newEvent * @ignorevalidation $newEvent * @return void */ public function newAction() { $user = $GLOBALS['TSFE']->fe_user->user['username']; $user_locationsIDs = $GLOBALS['TSFE']->fe_user->user['locations']; $locations = $this->locationRepository->findAllLocations($user_locationsIDs); $this->view->assignMultiple(array('user' => $user, 'locations' => $locations)); }
/** * action list * * @return void */ public function listAction() { $locations = $this->locationRepository->findAll(); $user = $GLOBALS['TSFE']->fe_user->user['username']; $user_locationsIDs = $GLOBALS['TSFE']->fe_user->user['locations']; $user_locations = $this->locationRepository->findAllLocations($user_locationsIDs); $all_user_locations = $this->locationRepository->findAllLocations(); foreach ($user_locations as $key => $value) { $location_Id[] = $value['uid']; } foreach ($all_user_locations as $key => $value) { if (in_array($value['uid'], $location_Id)) { $temp[$key] = 1; } else { $temp[$key] = 0; } $final_Id[$value['uid']] = $temp[$key]; $locations['loc'][$value['uid']] = $temp[$key]; } $this->view->assignMultiple(array('locations' => $locations, 'user_locations' => $user_locations, 'locationIds' => $final_Id)); }