function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addText("language", "Jazyk");
     $form->addText("code", "Kód");
     $form->addSubmit('send', 'dictionary.main.Save')->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->insertFormSucceeded;
     $form->onValidate[] = $this->permissionValidated;
     return $form;
 }
 /**
  * Edit event
  */
 function createComponentEditEventForm()
 {
     $page = $this->database->table("pages")->get($this->presenter->getParameter("id"));
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('id');
     $form->addHidden('event_id');
     $form->addText('date_event', 'dictionary.main.DateEventStarted')->setAttribute("class", "form-control datepicker")->setAttribute("style", "width: 110px; display: inline;")->setHtmlId("event_start");
     $form->addSelect("hour_event")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_hour")->setTranslator(null);
     $form->addSelect("minute_event")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_minute")->setTranslator(null);
     $form->addText('date_event_end', 'dictionary.main.DateEventEnded')->setAttribute("class", "form-control datepicker")->setAttribute("style", "width: 110px; display: inline;")->setHtmlId("event_end_date");
     $form->addSelect("hour_event_end")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_end_hour")->setTranslator(null);
     $form->addSelect("minute_event_end")->setAttribute("class", "form-control text-right")->setAttribute("style", "width: 80px; display: inline;")->setHtmlId("event_end_minute")->setTranslator(null);
     $form->addText('price', 'dictionary.main.Price')->setAttribute("class", "form-control");
     $form->addText('contact', 'dictionary.main.Place')->setAttribute("class", "form-control");
     $form->addText('time_range', 'Rozsah')->setAttribute("class", "form-control");
     $form->addCheckbox("allday", "dictionary.main.AllDayEvent");
     $form->addText('capacity', 'Kapacita')->setAttribute("class", "form-control");
     $form->addText('capacity_start', 'Kapacita (přidat)')->setAttribute("class", "form-control");
     $form->addSubmit('submitm', 'dictionary.main.Save')->setAttribute("class", "btn btn-success btn");
     $form->setDefaults(array("id" => $page->id));
     $form->onSuccess[] = $this->editEventFormSucceeded;
     return $form;
 }
 /**
  * Form: User fills in e-mail address to send e-mail with a password generator link
  */
 function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("id");
     $form->addHidden("contacts_id");
     $form->addText("name", "dictionary.main.Name");
     $form->addText("street", "dictionary.main.Street");
     $form->addText("zip", "dictionary.main.ZIP");
     $form->addText("city", "dictionary.main.City");
     $form->setDefaults(array("contacts_group_id" => 2));
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 /**
  * Form: User fills in e-mail address to send e-mail with a password generator link
  */
 function createComponentEditAddressForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("id");
     $form->addHidden("contacts_id");
     $form->addText("name", "dictionary.main.Name");
     $form->addText("street", "dictionary.main.Street");
     $form->addText("zip", "dictionary.main.ZIP");
     $form->addText("city", "dictionary.main.City");
     $address = $this->database->table("contacts")->get($this->presenter->getParameter("id"));
     $form->setDefaults(array("id" => $address->id, "name" => $address->name, "street" => $address->street, "zip" => $address->zip, "city" => $address->city));
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $form->onSuccess[] = $this->editAddressFormSucceeded;
     return $form;
 }
 /**
  * Form: User fills in e-mail address to send e-mail with a password generator link
  * @return string
  */
 function createComponentSendForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("layer");
     $form->addText("email", "dictionary.main.Email");
     $form->addSubmit('submitm', 'dictionary.main.Send');
     $form->onSuccess[] = $this->sendFormSucceeded;
     return $form;
 }
 function createComponentSendForm()
 {
     $helpdesk = $this->database->table("helpdesk")->get(1);
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addText("name", "messages.helpdesk.name")->setAttribute("placeholder", "messages.helpdesk.name");
     $form->addText("email", "messages.helpdesk.email")->setAttribute("placeholder", "messages.helpdesk.email")->setOption("description", 1);
     if ($helpdesk->fill_phone > 0) {
         $form->addText("phone", "messages.helpdesk.phone")->setAttribute("placeholder", "messages.helpdesk.phone")->setOption("description", 1);
     }
     $form->addTextArea("message", "messages.helpdesk.message")->setAttribute("placeholder", "messages.helpdesk.message")->setAttribute("class", "form-control");
     $form->setDefaults(array("name" => $this->getParameter("name"), "email" => $this->getParameter("email"), "phone" => $this->getParameter("phone"), "message" => $this->getParameter("message")));
     $form->addSubmit("submitm", "messages.helpdesk.send")->setAttribute("class", "btn btn-primary");
     $form->onValidate[] = $this->sendFormValidated;
     $form->onSuccess[] = $this->sendFormSucceeded;
     return $form;
 }
 /**
  * Edit category
  */
 protected function createComponentEditForm()
 {
     $carousel = $this->database->table("carousel")->get($this->presenter->getParameter("id"));
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('carousel_id');
     $form->addText('title', 'dictionary.main.Title');
     $form->addTextArea('description', 'dictionary.main.Description')->setAttribute("class", "form-control")->setAttribute("style", "max-height: 150px;");
     $form->addText('uri', 'dictionary.main.URL');
     $form->addCheckbox("visible", "dictionary.main.Show");
     $form->addUpload('the_file', 'dictionary.main.Icon');
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $arr = array("carousel_id" => $carousel->id, "title" => $carousel->title, "description" => $carousel->description, "visible" => $carousel->visible, "uri" => $carousel->uri);
     $form->setDefaults(array_filter($arr));
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
 protected function createComponentEditForm()
 {
     $categoryAll = new \App\Model\Category($this->database);
     $category = $this->database->table("categories")->get($this->presenter->getParameter("id"));
     $categories = $categoryAll->getAll();
     unset($categories[$category->id]);
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('id');
     $form->addText('title', 'dictionary.main.Title');
     $form->addSelect('parent', 'Nadřazená kategorie', $categories)->setPrompt('admin.categories.NothingRelated')->setAttribute("class", "form-control");
     $form->addText('url', 'dictionary.main.URL');
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $arr = array("id" => $category->id, "title" => $category->title, "parent" => $category->parent_id);
     $form->setDefaults(array_filter($arr));
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
 function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addText('title', 'dictionary.main.Title');
     $form->addSubmit('submitm', 'dictionary.main.Insert');
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 /**
  * Newsletter
  * @return \Nette\Forms\BootstrapUIForm
  */
 function createComponentAdd()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "";
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addText("email")->setAttribute("class", "form-control");
     $form->addSubmit("submitm", "messages.helpdesk.send")->setAttribute("class", "btn btn-yellow");
     $form->onValidate[] = $this->addValidated;
     $form->onSuccess[] = $this->addSucceeded;
     return $form;
 }
 /**
  * Insert event
  */
 function createComponentInsertEventForm()
 {
     $hours = array("00" => "00", "01" => "01", "02" => "02", "03" => "03", "04" => "04", "05" => "05", "06" => "06", "07" => "07", "08" => "08", "09" => "09", "10" => "10", "11" => "11", "12" => "12", "13" => "13", "14" => "14", "15" => "15", "16" => "16", "17" => "17", "18" => "18", "19" => "19", "20" => "20", "21" => "21", "22" => "22", "23" => "23");
     $minutes = array("00" => "00", "05" => "05", "10" => "10", "15" => "15", "20" => "20", "25" => "25", "30" => "30", "40" => "40", "45" => "45", "50" => "50", "55" => "55");
     $contacts = $this->database->table("contacts")->where("categories_id", 22)->fetchPairs('id', 'company');
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('id');
     $form->addHidden('event_id');
     $form->addText('date_event', 'dictionary.main.DateEventStarted')->setAttribute("class", "form-control datepicker")->setHtmlId("event_start");
     $form->addSelect("hour_event", "", $hours)->setAttribute("class", "form-control text-right")->setHtmlId("event_hour")->setTranslator(null);
     $form->addSelect("minute_event", "", $minutes)->setAttribute("class", "form-control text-right")->setHtmlId("event_minute")->setTranslator(null);
     $form->addText('date_event_end', 'dictionary.main.DateEventEnded')->setAttribute("class", "form-control datepicker")->setHtmlId("event_end_date");
     $form->addSelect("hour_event_end", "", $hours)->setAttribute("class", "form-control text-right")->setHtmlId("event_end_hour")->setTranslator(null);
     $form->addSelect("minute_event_end", "", $minutes)->setAttribute("class", "form-control text-right")->setHtmlId("event_end_minute")->setTranslator(null);
     $form->addText('price', 'dictionary.main.Price')->setAttribute("class", "form-control");
     $form->addSelect('contact', 'dictionary.main.Place', $contacts)->setAttribute("class", "form-control");
     $form->addText('time_range', 'Rozsah')->setAttribute("class", "form-control");
     $form->addText('capacity', 'Kapacita')->setAttribute("class", "form-control");
     $form->addText('capacity_start', 'Kapacita (přidat)')->setAttribute("class", "form-control");
     $form->addCheckbox("allday", "dictionary.main.AllDayEvent");
     $form->setDefaults(array("event_id" => $this->presenter->getParameter("id"), "capacity_start" => 0));
     $form->addSubmit('submitm', 'dictionary.main.Save')->setAttribute("class", "btn btn-success btn");
     $form->onSuccess[] = $this->insertEventFormSucceeded;
     return $form;
 }
 /**
  * Send teste-mail
  */
 function createComponentSendForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->addHidden("id");
     $form->addText("email", "E-mail");
     $form->addSubmit('submitm', 'dictionary.main.Save');
     $form->setDefaults(array("id" => $this->presenter->getParameter("id")));
     $form->onSuccess[] = $this->sendFormSucceeded;
     return $form;
 }
 protected function createComponentFilterForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('id');
     $form->addText('src', 'dictionary.main.Title');
     $form->addSubmit('submitm', 'dictionary.main.Search');
     $form->setDefaults(array("id" => $this->getParameter("id")));
     $form->onSuccess[] = $this->filterFormSucceeded;
     return $form;
 }
 function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("id");
     $form->addText("title", "dictionary.main.Title")->setRequired($this->presenter->translator->translate('messages.pages.NameThePage'));
     $form->setDefaults(array("section" => $this->presenter->getParameter('id')));
     $form->addSubmit("submit", "dictionary.main.Create")->setHtmlId('formxins');
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 /**
  * Insert category
  */
 protected function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("parent");
     $form->addText('title', 'dictionary.main.Title')->setAttribute("class", "form-control");
     $form->addSubmit('submitm', 'dictionary.main.Insert')->setAttribute("class", "btn btn-primary");
     $form->onSuccess[] = $this->insertFormSucceeded;
     $form->onValidate[] = $this->validateFormSucceeded;
     return $form;
 }
 protected function createComponentSignInForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("type");
     $form->addText("username", 'dictionary.main.User')->setRequired('Vložte uživatelské jméno.');
     $form->addPassword("password", 'dictionary.main.Password')->setRequired('Vložte heslo.');
     $form->addSubmit("send", 'dictionary.main.login')->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->signInFormSucceeded;
     return $form;
 }
 protected function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $languages = $this->database->table("languages")->where(array("default" => null, "used" => 1));
     if ($languages->count() > 1) {
         $form->addGroup("čeština");
     }
     $form->addHidden("parent");
     $form->addText('title', 'dictionary.main.Title')->setAttribute("class", "form-control");
     $form->addText('url', 'dictionary.main.URL')->setAttribute("class", "form-control");
     foreach ($languages as $item) {
         $form->addGroup($item->title);
         $form->addText("title_" . $item->code, 'dictionary.main.Title')->setAttribute("class", "form-control");
         $form->addText("url_" . $item->code, 'dictionary.main.URL')->setAttribute("class", "form-control");
     }
     $form->addSubmit('submitm', 'dictionary.main.Insert')->setAttribute("class", "btn btn-primary");
     $form->onSuccess[] = $this->insertFormSucceeded;
     $form->onValidate[] = $this->validateFormSucceeded;
     return $form;
 }
 /**
  * E-mail template edit
  */
 function createComponentEditForm()
 {
     $emailDb = $this->database->table("helpdesk_emails")->get($this->presenter->getParameter("id"));
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->id = "search-form";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("id");
     $form->addText("subject");
     $form->addTextArea("body")->setAttribute("style", "width: 500px;")->setHtmlId("wysiwyg");
     $form->setDefaults(array("id" => $this->presenter->getParameter("id"), "subject" => $emailDb->subject, "body" => $emailDb->body));
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
Exemple #19
0
 /**
  * Edit your profile
  */
 function createComponentEditForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addGroup("Osobní údaje");
     $form->addText("username", "Uživatel")->setAttribute("style", "border: 0; font-size: 1.5em;")->setDisabled();
     $form->addRadioList('sex', 'Pohlaví', array(1 => " " . 'žena', 2 => " " . 'muž'))->setAttribute("class", "checkboxlistChoose");
     $form->setDefaults(array("username" => $this->presenter->template->member->username, "sex" => $this->presenter->template->member->sex));
     $form->addSubmit("submit", "dictionary.main.Save");
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
Exemple #20
0
 /**
  * Edit by user
  */
 function createComponentEditForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $members = $this->database->table("users")->get($this->presenter->user->getId());
     $cols = array("username" => $members->username, "email" => $members->email, "name" => $members->name);
     $form->addGroup("Základní nastavení");
     $form->addText("name", "Name");
     $form->setDefaults(array("name" => $cols["name"]));
     $form->addSubmit("submit", "dictionary.main.Save");
     $form->onSuccess[] = array($this, 'editFormSucceeded');
     return $form;
 }
 /**
  * Insert communication
  */
 function createComponentInsertForm()
 {
     $types = array("E-mail" => "E-mail", "Telefon, domácí" => "Telefon, domácí", "Telefon, pracovní" => "Telefon, pracovní", "Fax" => "Fax", "Webová adresa" => "Webová adresa", "Skype" => "Skype");
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("id");
     $form->addSelect('type', 'Typ komunikace', $types)->setAttribute('class', 'form-control');
     $form->addText('type_value', 'Hodnota');
     $form->addSubmit("submitm", "dictionary.main.Insert")->setAttribute("class", "btn btn-success");
     $form->setDefaults(array("id" => $this->presenter->getParameter('id')));
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 /**
  * Edit file information
  */
 function createComponentEditForm()
 {
     $image = $this->database->table("media")->get($this->presenter->getParameter("id"));
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('id');
     $form->addText('title', 'dictionary.main.Title');
     $form->addTextarea('description', "dictionary.main.Description")->setAttribute("style", "height: 200px;")->setAttribute("class", "form-control");
     $form->setDefaults(array("id" => $image->id, "title" => $image->title, "description" => $image->description));
     $form->addSubmit('send', 'dictionary.main.Save');
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
 function createComponentEditSettingsForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('category_id');
     $form->addHidden('setkey');
     $form->addText("setvalue", "dictionary.main.Description");
     $arr = array_filter(array("category_id" => $this->presenter->getParameter("id")));
     $form->setDefaults($arr);
     $form->addSubmit('send', 'dictionary.main.Save')->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->editSettingsSucceeded;
     $form->onValidate[] = $this->permissionValidated;
     return $form;
 }
 /**
  * Edit helpdesk
  */
 function createComponentEditForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden("helpdesk_id");
     $form->addText("title", "dictionary.main.Title");
     $form->addTextarea("description", "dictionary.main.Description")->setAttribute("class", "form-control")->setAttribute("style", "height: 200px;");
     $form->addCheckbox("fill_phone");
     $helpdesk = $this->database->table("helpdesk")->get($this->presenter->getParameter("id"));
     $form->setDefaults(array("helpdesk_id" => $helpdesk->id, "title" => $helpdesk->title, "description" => $helpdesk->description, "fill_phone" => $helpdesk->fill_phone));
     $form->addSubmit("submitm", "dictionary.main.Save");
     $form->onSuccess[] = $this->editFormSucceeded;
     return $form;
 }
 /**
  * Edit contact
  */
 function createComponentLoadForm()
 {
     $this->template->id = $this->presenter->getParameter('id');
     $contact = $this->database->table("contacts")->where("pages_id", $this->presenter->getParameter("id"));
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('contact_id');
     $form->addHidden('pages_id');
     $form->addText("vatin", "Načíst IČ")->setAttribute("placeholder", "dictionary.main.VatIn")->setOption("description", 1);
     $form->setDefaults(array("contact_id" => $contact->fetch()->id, "pages_id" => $this->presenter->getParameter("id")));
     $form->addSubmit("submitm", "Načíst")->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->loadVatFormSucceeded;
     return $form;
 }
 public function createComponentSignUpForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addGroup("Uživatelské informace");
     $form->addText("email", "E-mail")->addRule(\Nette\Forms\Form::EMAIL, 'Zadejte platný email.')->setRequired('Vložte e-mail.');
     $form->addText("username", "Uživatelské jméno")->setOption('description', (string) "Povoleny jsou pouze znaky a-z, 0-9 (pouze malá písmena)")->setRequired('Zvolte si uživatelské jméno')->addRule(\Nette\Forms\Form::PATTERN, 'Uživatelské jméno může obsahovat pouze znaky a-z, 0-9 (pouze malá písmena)', '[a-z0-9-]+')->addRule(\Nette\Forms\Form::MIN_LENGTH, 'Zvolte uživatelské jméno s alespoň %d znaky', 5)->addRule(\Nette\Forms\Form::MAX_LENGTH, 'Zvolte uživatelské jméno s nejvýše %d znaky', 40);
     if ($this->presenter->template->settings['members:groups:enabled']) {
         $groups = $this->database->table("categories")->where("parent_id", $this->presenter->template->settings['members:group:categoryId'])->fetchPairs("id", "title");
         $form->addSelect("group", "Skupina", $groups)->setAttribute("class", "form-control");
     }
     $form->addPassword("pwd", "dictionary.main.Password")->setOption('description', (string) "6 - 40 znaků")->setRequired('Zvolte si heslo')->addRule(\Nette\Forms\Form::MIN_LENGTH, 'Zvolte heslo s alespoň %d znaky', 6)->addRule(\Nette\Forms\Form::MAX_LENGTH, 'Zvolte heslo s nejvýše %d znaky', 40);
     $form->addPassword("pwd2", "Zopakovat heslo")->setRequired('Zadejte prosím heslo ještě jednou pro kontrolu')->addRule(\Nette\Forms\Form::EQUAL, 'Hesla se neshodují', $form['pwd']);
     if ($this->presenter->template->settings['members:signup:contactEnabled']) {
         $form->addGroup("Kontaktní údaje");
         $form->addText("name", "Jméno a příjmení")->setRequired('Zadejte jméno')->addRule(\Nette\Forms\Form::MIN_LENGTH, 'Zadejte jméno', 3)->addRule(\Nette\Forms\Form::MAX_LENGTH, 'Zadejte jméno', 200);
         $form->addText("street", "dictionary.main.Street")->setRequired('Zadejte ulici')->addRule(\Nette\Forms\Form::MIN_LENGTH, 'Zadejte ulici', 3)->addRule(\Nette\Forms\Form::MAX_LENGTH, 'Zadejte ulici', 200)->setAttribute("class", "smartform-street-and-number");
         $form->addText("zip", "PSČ")->setRequired('Zadejte PSČ')->addRule(\Nette\Forms\Form::MIN_LENGTH, 'Zadejte PSČ', 3)->addRule(\Nette\Forms\Form::MAX_LENGTH, 'Zadejte PSČ', 20)->setAttribute("class", "smartform-city");
         $form->addText("city", "Město")->setRequired('Zadejte město')->addRule(\Nette\Forms\Form::MIN_LENGTH, 'Zadejte město', 1)->addRule(\Nette\Forms\Form::MAX_LENGTH, 'Zadejte město', 80)->setAttribute("class", "smartform-zip");
     }
     if ($this->presenter->template->settings['members:signup:contactEnabled']) {
         $form->addGroup("Firemní informace");
         $form->addText("company", "dictionary.main.Company");
         $form->addText("vatin", "dictionary.main.VatIn");
         $form->addText("vatid", "dictionary.main.VatId");
     }
     $form->addCheckbox("newsletter", " " . "Chci odebírat zprávy?")->setDefaultValue(TRUE);
     $form->addCheckbox("confirmation", " " . "Souhlasím s podmínkami")->setRequired('Pro pokračování zaškrtněte Souhlasím s podmínkami');
     $form->setDefaults(array("username" => $this->presenter->getParameter("user"), "email" => $this->presenter->getParameter("email"), "newsletter" => $this->presenter->getParameter("newsletter"), "name" => $this->presenter->getParameter("name"), "street" => $this->presenter->getParameter("street"), "city" => $this->presenter->getParameter("city"), "zip" => $this->presenter->getParameter("zip")));
     $form->addSubmit("submit", "Registrovat se")->setAttribute("class", "btn-lg btn-cart-in");
     $form->setDefaults(array("email" => $this->getParameter("email"), "username" => $this->getParameter("username"), "newsletter" => $this->getParameter("newsletter")));
     $form->onSuccess[] = $this->signUpFormSucceeded;
     $form->onValidate[] = $this->signUpFormValidated;
     return $form;
 }
 /**
  * Insert hour
  */
 function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('contact_id');
     $form->addHidden('page_id');
     $form->addSelect('day', 'dictionary.main.DayOfTheWeek', array(1 => 'dictionary.days.Monday', 2 => 'dictionary.days.Tuesday', 3 => 'dictionary.days.Wednesday', 4 => 'dictionary.days.Thursday', 5 => 'dictionary.days.Friday', 6 => 'dictionary.days.Saturday', 7 => 'dictionary.days.Sunday'))->setAttribute("class", "form-control");
     $form->addText('hourstext', 'Hodiny (např. 14.00-20.00) nebo zpráva (např. jen objednaní)')->setRequired('Vložte hodiny od-do nebo nějakou informaci');
     $contact = $this->database->table("contacts")->where("pages_id", $this->presenter->getParameter("id"))->fetch();
     $form->setDefaults(array("contact_id" => $contact->id, "page_id" => $this->presenter->getParameter("id")));
     $form->addSubmit("submitm", "dictionary.main.Insert")->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->insertFormSucceeded;
     $form->onValidate[] = $this->validateFormSucceeded;
     return $form;
 }
 function createComponentInsertForm()
 {
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addHidden('category');
     $form->addHidden('type');
     $form->addText('title', 'dictionary.main.Title');
     $form->addTextarea("preview", "dictionary.main.Description")->setAttribute("class", "form-control");
     if ($this->presenter->getParameter("type") == 6 && $this->presenter->getParameter('id') == false) {
         $category = 4;
     } elseif ($this->presenter->getParameter("type") == 8 && $this->presenter->getParameter('id') == false) {
         $category = 6;
     } else {
         $category = $this->presenter->getParameter('id');
     }
     $form->setDefaults(array("category" => $category, "type" => $this->presenter->getParameter("type")));
     $form->addSubmit('submitm', 'dictionary.main.Insert');
     $form->onSuccess[] = $this->insertFormSucceeded;
     return $form;
 }
 /**
  * Edit contact
  */
 function createComponentEditForm()
 {
     $this->template->id = $this->presenter->getParameter('id');
     $categories = new \App\Model\Category($this->database);
     $cats = $categories->getSubIds(2);
     $groups = $this->database->table("categories")->where("id", $cats)->fetchPairs("id", "title");
     $form = new \Nette\Forms\BootstrapUIForm();
     $form->setTranslator($this->presenter->translator);
     $form->getElementPrototype()->class = "form-horizontal";
     $form->getElementPrototype()->role = 'form';
     $form->getElementPrototype()->autocomplete = 'off';
     $form->addGroup('');
     $form->addHidden('contact_id');
     $form->addHidden('pages_id');
     $form->addText("name", "dictionary.main.Name")->setAttribute("placeholder", "dictionary.main.Name");
     $form->addText("company", "dictionary.main.Company")->setAttribute("placeholder", "dictionary.main.Company");
     $form->addRadioList("type", "Osoba nebo organizace", array(0 => " osoby", 1 => " organizace"));
     $form->addText("post", "dictionary.main.Post")->setAttribute("placeholder", "dictionary.main.Post")->setOption("description", 1);
     $form->addText("email", "E-mail")->setAttribute("placeholder", "dictionary.main.Email")->setAttribute("class", "form-control");
     $form->addText("phone", "dictionary.main.Phone")->setAttribute("placeholder", "dictionary.main.Phone")->setAttribute("class", "form-control");
     $form->addSelect("categories_id", "dictionary.main.Category", $groups)->setAttribute("class", "form-control");
     $form->addGroup('dictionary.main.Address');
     $form->addText("street", "Ulice")->setAttribute("placeholder", "dictionary.main.Street")->setOption("description", 1);
     $form->addText("zip", "dictionary.main.ZIP")->setAttribute("placeholder", "dictionary.main.ZIP")->setOption("description", 1);
     $form->addText("city", "Město")->setAttribute("placeholder", "Město")->setOption("description", 1);
     $form->addGroup('Firemní údaje');
     $form->addText("vatin", "IČ")->setAttribute("placeholder", "dictionary.main.VatIn")->setOption("description", 1);
     $form->addText("vatid", "DIČ")->setAttribute("placeholder", "dictionary.main.VatId")->setHtmlId("kurzy_ico")->setOption("description", 1);
     $form->addText("banking_account", "Bankovní účet")->setAttribute("placeholder", "Bankovní účet")->setOption("description", 1);
     $form->addText("dateofbirth", "Datum narození")->setAttribute("placeholder", "Datum narození");
     $form->addGroup('Ostatní');
     $form->addTextArea("notes", "dictionary.main.Notes")->setAttribute("class", "form-control");
     $page = $this->database->table("pages")->get($this->presenter->getParameter("id"));
     $contact = $this->database->table("contacts")->where("pages_id", $this->presenter->getParameter("id"))->fetch();
     $arr = array("contact_id" => $contact->id, "pages_id" => $page->id, "name" => $contact->name, "company" => $contact->company, "post" => $contact->post, "type" => $contact->type, "email" => $contact->email, "phone" => $contact->phone, "categories_id" => $contact->categories_id, "street" => $contact->street, "zip" => $contact->zip, "city" => $contact->city, "banking_account" => $contact->banking_account, "vatin" => $contact->vatin, "vatid" => $contact->vatid, "notes" => $contact->notes, "dateofbirth" => $contact->date_of_birth);
     $form->setDefaults($arr);
     $form->addSubmit("submitm", "dictionary.main.Save")->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->editFormSucceeded;
     $form->onValidate[] = $this->editFormValidated;
     return $form;
 }