protected function createComponentForm() { $form = new Form(); $form->addText('description', 'Popis výčetky:')->setRequired('Vyplňte pole Popis Výčetky.')->setAttribute('placeholder', 'Vyplňte popis výčetky'); $form['recipient'] = $this->recipientsSelectBoxFactory->create($this->user, array_merge($this->users, $this->restrictedUsers)); $form['recipient']->setAttribute('size', 10); $form->addSubmit('send', 'Odeslat výčetku'); $form->onSuccess[] = [$this, 'processListingSharing']; //$form->onSuccess[] = [$this, 'sendNotifications']; return $form; }
protected function createComponentNewMessageForm() { $this->loadUsers(); $form = new Form(); $form->addText('subject', 'Předmět', 35, 80)->setRequired('Vyplňte prosím předmět zprávy.'); $form->addTextArea('text', 'Zpráva', 65, 12)->setRequired('Vyplňte prosím text zprávy.')->addRule(Form::MAX_LENGTH, 'Zpráva může obsahovat maximálně %d znaků.', 2000); $form['recipients'] = $this->recipientsSelectBoxFactory->create($this->user, $this->possibleRecipients, $this->authorizator->isAllowed($this->user, 'message', 'send_to_multiple_recipients')); $form->addCheckbox('isSendAsAdmin', 'Odeslat zprávu jako správce aplikace'); $form->addSubmit('send', 'Odeslat'); $form->getElementPrototype()->id = 'new-message-form'; $form->onSuccess[] = [$this, 'processNewMessageForm']; $form->addProtection(); return $form; }