/** * Processing of Add calendar Form * * @Privilege("createcalendar") * * @param Form $form */ public function addCalendarFormSucceded(Form $form) { $values = $form->getValues(TRUE); unset($values['send']); if ($this->calendars->getCalendar($values['year'], $values['yearpart'])) { //intentionally not form error, since they have what they need $this->flashMessage("Kalendář pro " . $values['yearpart'] . " " . $values['year'] . " už existuje."); } else { $this->calendars->insert($values); $this->flashMessage("Kalednář byl úspěšně přídán"); } $this->redirect('Event:'); }