/**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $entity = $form->data;
     $form->addGroup('Supplier');
     $form->addManyToOne('supplier', 'person')->addRule($form::FILLED);
     $form->addGroup('Customer');
     $form->addManyToOne('customer', 'person')->addRule($form::FILLED);
     $form->addGroup('Billing information');
     $form->addText('identification', 'Identification');
     $form->addText('amount', 'Amount')->addRule($form::FILLED)->addRule($form::FLOAT);
     $form->addManyToOne('payment', 'Payment');
     $form->addSelect('type', 'Type')->setItems(InvoiceEntity::getTypes());
     $form->addSelect('state', 'State')->setItems(InvoiceEntity::getStates());
     $form->addText('constantSymbol', 'Constant sb.');
     $form->addText('variableSymbol', 'Variable sb.');
     $form->addText('specificSymbol', 'Specific sb.');
     $group = $form->addGroup('Items');
     $recipients = $form->addMany('items', function (Container $container) use($group, $form) {
         $container->setCurrentGroup($group);
         $container->addText('name', 'Name')->addRule($form::FILLED);
         $container->addText('unitValue', 'Unit value')->addRule($form::FILLED)->addRule($form::FLOAT);
         $container->addText('units', 'Units')->addRule($form::FILLED)->addRule($form::INTEGER);
         $container->addText('qUnit', 'Quantity unit')->addRule($form::FILLED);
         $container->addText('tax', 'Tax')->addRule($form::FLOAT);
         $container->addCheckbox('unitValueIsTaxed', 'Value is taxed');
         $container->addSubmit('remove', 'Remove')->addRemoveOnClick();
     }, function () use($entity) {
         return new ItemEntity($entity);
     });
     $recipients->setCurrentGroup($group);
     $recipients->addSubmit('add', 'Add item')->addCreateOnClick();
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #2
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup();
     $form->addText('name', 'Name');
     $form->addText('localUrl', 'URL');
     $form->addText('title', 'Title');
     $form->addText('keywords', 'Keywords');
     $form->addText('description', 'Description');
     $form->addManyToOne('author', 'Author');
     $form->addSelect('robots', 'Robots')->setItems(RouteEntity::getRobotsValues(), FALSE);
     $form->addSelect('changefreq', 'Change frequency')->setItems(RouteEntity::getChangefreqValues(), FALSE)->setPrompt('-------');
     $form->addSelect('priority', 'Priority')->setItems(RouteEntity::getPriorityValues(), FALSE)->setPrompt('-------');
     // layout
     $form->setCurrentGroup($form->addGroup());
     $form->addCheckbox('copyLayoutFromParent', 'Layout from parent');
     $form['copyLayoutFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-layout_' . $form->data->id);
     $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout_' . $form->data->id));
     $form->addManyToOne('layout', 'Layout');
     $form->setCurrentGroup($form->addGroup());
     $form->addCheckbox('copyLayoutToChildren', 'Share layout with children');
     $form['copyLayoutToChildren']->addCondition($form::EQUAL, FALSE)->toggle('group-layout2_' . $form->data->id);
     $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-layout2_' . $form->data->id));
     $form->addManyToOne('childrenLayout', 'Share new layout');
     // cache
     $form->setCurrentGroup($form->addGroup());
     $form->addCheckbox('copyCacheModeFromParent', 'Cache mode from parent');
     $form['copyCacheModeFromParent']->addCondition($form::EQUAL, FALSE)->toggle('group-cache_' . $form->data->id);
     $form->setCurrentGroup($form->getForm()->addGroup()->setOption('id', 'group-cache_' . $form->data->id));
     $form->addSelect('cacheMode', 'Cache strategy')->setItems(\CmsModule\Content\Entities\RouteEntity::getCacheModes(), FALSE)->setPrompt('off');
     $form->setCurrentGroup($form->addGroup());
     $form->addFileEntityInput('photo', 'Photo');
     $form->addTextArea('notation', 'Notation');
     $form->addTextArea('text', 'Text');
     $form->addGroup('Dates');
     $form->addDateTime('created', 'Created')->setDisabled(TRUE);
     $form->addDateTime('updated', 'Updated')->setDisabled(TRUE);
     $form->addDateTime('released', 'Released')->addRule($form::FILLED);
     $form->addDateTime('expired', 'Expired');
     $form->addGroup('Tags');
     $form->addContentTags('tags');
     $aliases = $form->addMany('aliases', function (\Venne\Forms\Container $container) use($form) {
         $container->setCurrentGroup($form->addGroup('URL alias'));
         $container->addText('aliasUrl', 'Url')->setRequired();
         $container->addText('aliasLang', 'Language alias');
         $container->addText('aliasDomain', 'Domain url');
         $container->addSubmit('remove', 'Remove alias')->addRemoveOnClick();
     });
     $aliases->addSubmit('add', 'Add alias')->addCreateOnClick();
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #3
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('startDepth', 'Start depth')->addCondition($form::FILLED)->addRule($form::INTEGER);
     $form->addText('maxDepth', 'Max depth')->addCondition($form::FILLED)->addRule($form::INTEGER);
     $form->addManyToOne('root', 'Root page');
     $form->addSaveButton('Save');
 }
 public function configure(Form $form)
 {
     $_this = $this;
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $route->setCurrentGroup($group);
     $form->addText('name', 'Name');
     $form->addText('price', 'Price')->setDefaultValue(0)->addCondition($form::FILLED)->addRule($form::FLOAT);
     $form->addText('rrp', 'RRP')->addCondition($form::FILLED)->addRule($form::FLOAT);
     $route->addTextArea('notation', 'Description');
     $route->addFileEntityInput('photo', 'Image');
     $form->addText('inStock', 'In stock')->addCondition($form::FILLED)->addRule($form::FLOAT);
     $form->addGroup('');
     $form->addManyToOne('category', 'Main category');
     $form->addManyToMany('categories', 'Next categories');
     $form->addGroup();
     $form->addManyToMany('labels', 'Labels');
     $tags = $form->addContainer('tags');
     $tags->setCurrentGroup($group = $form->addGroup());
     $form->addGroup('Types');
     $form->addTags('typesAsArray', 'Types')->setSuggestCallback(function () use($_this, $form) {
         $ret = array();
         foreach ($_this->getTagsFromCategories($form) as $tag) {
             $ret[$tag] = $tag;
         }
         return $ret;
     })->setDelimiter('[;]+')->setJoiner(';');
     $form->addGroup();
     $form->addSaveButton('Save');
 }
Example #5
0
 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup();
     $form->addText('name', 'Name');
     if ($form->data->id) {
         $form->addManyToOne('parent', 'Parent')->setCriteria(array('invisible' => FALSE))->setOrderBy(array('path' => 'ASC'));
     }
     $form->addGroup('Permissions');
     $form->addManyToOne('author', 'Owner');
     $form->addManyToMany('write', 'Write');
     $form->addManyToMany('read', 'Read');
     $form->addCheckbox('protected', 'Protected');
     $form->addCheckbox('recursively', 'Change recursively');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #6
0
 public function configure(Form $form)
 {
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $form->addOne('route')->setCurrentGroup($group)->addTextArea('notation', 'Notation', NULL, 4)->getControlPrototype()->attrs['class'] = 'input-block-level';
     $form->addManyToOne('linkedRoute', 'Linked route')->setCriteria(array('page' => $form->data->extendedPage->linkedPage->id));
     $form->addSaveButton('Save');
 }
Example #7
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Options');
     $form->addManyToOne('rootPage', 'Root page')->setPrompt(NULL);
     $form->addText('maxDepth', 'Maximal depth')->addRule($form::INTEGER);
     $form->addText('maxWidth', 'Maximal width')->addRule($form::INTEGER);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Options');
     $form->addManyToOne('newsletter', 'Newsletter')->setOrderBy(array('created' => 'DESC'))->setPrompt(NULL);
     $form->addCheckbox('allUsers', 'Send to all')->addCondition($form::EQUAL, FALSE)->toggle('form-users');
     $form->addGroup()->setOption('id', 'form-users');
     $form->addManyToMany('users', 'Users');
     $form->addGroup();
     $form->addSaveButton('Odeslat newsletter');
 }
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('name', 'Name');
     $form->addManyToOne('account', 'Account')->addRule($form::FILLED);
     $form->addText('identificationFormat', 'ID format')->addRule($form::FILLED);
     $form->addSelect('identificationInterval', 'ID interval', AccountEntity::getIntervals())->addRule($form::FILLED);
     $form->addText('due', 'Invoice due')->addRule($form::FILLED)->addRule($form::INTEGER);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #10
0
 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addGroup();
     if ($form->data->id) {
         $form->addText('name', 'Name')->addCondition($form::FILLED);
     } else {
         $form->addUpload('file', 'File')->addCondition($form::FILLED);
     }
     if ($form->data->id) {
         $form->addManyToOne('parent', 'Parent')->setCriteria(array('invisible' => FALSE))->setOrderBy(array('path' => 'ASC'));
     }
     $form->addGroup('Permissions');
     $form->addManyToOne('author', 'Owner');
     $form->addManyToMany('write', 'Write');
     $form->addCheckbox('protected', 'Protected')->addCondition($form::EQUAL, TRUE)->toggle('form-permissions');
     $form->addGroup()->setOption('id', 'form-permissions');
     $form->addManyToMany('read', 'Read');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #11
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addManyToOne('account', 'Account');
     $form->addManyToOne('offset', 'Offset');
     $form->addText('paymentId', 'Payment ID');
     $form->addDateTime('date', 'Date');
     $form->addText('amount', 'Amount');
     $form->addText('constantSymbol', 'Constant sb.');
     $form->addText('variableSymbol', 'Variable sb.');
     $form->addText('specificSymbol', 'Specific sb.');
     $form->addText('userIdentification', 'User identific.');
     $form->addTextArea('message', 'Message')->addRule($form::MAX_LENGTH, NULL, 140);
     $form->addText('type', 'Type');
     $form->addText('performed', 'Performed')->addRule($form::MAX_LENGTH, NULL, 50);
     $form->addText('specification', 'Specification');
     $form->addText('comment', 'Comment');
     $form->addText('bic', 'BIC');
     $form->addText('instructionId', 'Instruction ID');
     $form->addSaveButton('Save');
 }
Example #12
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup();
     $langMode = $form->addSelect('langMode', 'Language mode', ElementEntity::getLangModes());
     $langMode->addCondition($form::EQUAL, ElementEntity::LANGMODE_SPLIT)->toggle('form-group-language');
     $form->setCurrentGroup($form->addGroup()->setOption('id', 'form-group-language'));
     $form->addManyToOne('language', 'Language')->addConditionOn($langMode, $form::EQUAL, ElementEntity::LANGMODE_SPLIT)->addRule($form::FILLED);
     $form->addGroup();
     $mode = $form->addSelect('mode', 'Share data with', ElementEntity::getModes());
     $mode->addCondition($form::IS_IN, array(1))->toggle('form-group-layout')->endCondition()->addCondition($form::IS_IN, array(2, 4))->toggle('form-group-page')->endCondition()->addCondition($form::EQUAL, 4)->toggle('form-group-route');
     $form->addGroup()->setOption('id', 'form-group-layout');
     $form->addManyToOne('layout', 'Layout')->addConditionOn($mode, $form::IS_IN, array(1))->addRule($form::FILLED);
     $form->addGroup()->setOption('id', 'form-group-page');
     $page = $form->addManyToOne('page', 'Page');
     $page->addConditionOn($mode, $form::IS_IN, array(2, 4))->addRule($form::FILLED);
     $form->addGroup()->setOption('id', 'form-group-route');
     $form->addManyToOne('route', 'Route')->setDependOn($page, 'page')->addConditionOn($mode, $form::EQUAL, 4)->addRule($form::FILLED);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #13
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $route->setCurrentGroup($group);
     $route->addTextArea('notation', 'Notation');
     $form->addManyToOne('parent', 'Parent');
     $route->addFileEntityInput('photo', 'Photo');
     $form->addGroup();
     $form->addSaveButton('Save');
 }
 public function configure(Form $form)
 {
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $route->setCurrentGroup($group);
     $route->addTextArea('description', 'Description')->getControlPrototype()->attrs['class'] = 'input-block-level';
     $route->addFileEntityInput('photo', 'Photo');
     $form->addManyToOne('parent', 'Parent');
     //$form->addManyToMany('types', 'Types');
     $form->addTags('typesAsArray', 'Types')->setDelimiter('[;]+')->setJoiner(';');
     $form->addSaveButton('Save');
 }
Example #15
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addText('itemsPerPage', 'Items per page');
     $form->addManyToOne('linkedPage', 'Linked page');
     $form->addGroup('Notation');
     $form->addCheckbox('notationInHtml', 'In HTML format');
     $form->addCheckbox('autoNotation', 'Auto generate')->addCondition($form::EQUAL, true)->toggle('notationLength');
     $form->addGroup()->setOption('id', 'notationLength');
     $form->addText('notationLength', 'Length')->addRule($form::INTEGER);
     $form->addGroup();
     $form->addSaveButton('Save');
 }
Example #16
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $codes = $this->getCodes();
     $form->addGroup();
     $form->addManyToOne('person', 'Person');
     $c = $form->addManyToOne('bank', 'Bank')->addRule($form::FILLED);
     foreach ($codes as $id => $code) {
         $c->addCondition($form::EQUAL, $id)->toggle('form-' . $code);
     }
     $form->addDateTime('syncDate', 'Last sync. date')->addRule($form::FILLED);
     $form->addText('name', 'Account number')->addRule($form::FILLED);
     $form->addManyToOne('currency', 'Currency')->addRule($form::FILLED);
     $form->addText('iban', 'IBAN');
     $form->addText('bic', 'BIC');
     $drivers = $form->addContainer('drivers');
     foreach ($this->paymentManager->getDrivers() as $driver) {
         $container = $drivers->addContainer($driver->getCode());
         $container->setCurrentGroup($form->addGroup($driver->getName())->setOption('id', 'form-' . $driver->getCode()));
         $driver->configureOptionsContainer($container);
     }
     $form->addGroup();
     $form->addSaveButton('Save');
 }
Example #17
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Redirection');
     $form->addRadioList('type', 'Type', array('page' => 'Page', 'url' => 'URL'));
     $form['type']->addCondition($form::EQUAL, 'page')->toggle('page');
     $form['type']->addCondition($form::EQUAL, 'url')->toggle('url');
     $form['type']->getControlPrototype()->onClick = 'if( $(this).val() == "page" ) { $("#url").find("input").val("") } else ( $("#page").find("select").val("") );';
     $form->addGroup()->setOption('id', 'url');
     $form->addText('redirectUrl', 'URL');
     $form->addGroup()->setOption('id', 'page');
     $form->addManyToOne('redirect', 'Page');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #18
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addManyToOne('registration', 'Register by');
     $form->addGroup('Forgot password');
     $enabled = $form->addCheckbox('resetEnabled', 'Enabled');
     $enabled->addCondition($form::EQUAL, TRUE)->toggle('form-reset');
     $form->addGroup()->setOption('id', 'form-reset');
     $form->addText('resetSubject', 'Subject')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED);
     $form->addText('resetSender', 'Sender')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED);
     $form->addText('resetFrom', 'From')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED)->addRule($form::EMAIL);
     $form->addTextArea('resetText', 'Text')->addConditionOn($enabled, $form::EQUAL, TRUE)->addRule($form::FILLED);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #19
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $route = $form->addOne('route');
     $form->addGroup();
     $form->addManyToOne('parent', 'Parent');
     $group = $form->addGroup('Author');
     $authorName = $form->addText('author', 'Name');
     $route->setCurrentGroup($group);
     $author = $route->addManyToOne('author', 'Author');
     $authorName->addConditionOn($author, $form::FILLED)->addRule($form::EQUAL, '')->elseCondition()->addRule($form::FILLED);
     $author->addConditionOn($authorName, $form::FILLED)->addRule($form::EQUAL, '')->elseCondition()->addRule($form::FILLED);
     $form->addGroup('Text');
     $form->addTextArea('text', 'Text')->setRequired(TRUE)->getControlPrototype()->attrs['class'][] = 'span12';
     $form->addSaveButton('Save');
 }
Example #20
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $route = $form->addOne('route');
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $route->setCurrentGroup($group);
     $route->addFileEntityInput('photo', 'Photo');
     $route->addManyToOne('author', 'Author')->setDisabled(TRUE);
     $form->addManyToOne('category', 'Main category');
     $form->addManyToMany('categories', 'Categories');
     $route->addDateTime('released', 'Release date')->addRule($form::FILLED);
     $route->addDateTime('expired', 'Expiry date');
     $route->addTextArea('notation', 'Notation');
     $route->setCurrentGroup($form->addGroup('Content'));
     $route->addContentEditor('text', NULL, NULL, 20);
     $form->addSaveButton('Save');
 }
Example #21
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Kontakty');
     $form->addText('city', 'Město');
     $form->addText('street', 'Ulice');
     $form->addText('zip', 'PSČ');
     $form->addText('phone', 'Telefon');
     $form->addText('email', 'E-mail');
     $form->addText('account', 'Číslo účtu');
     $form->addGroup('Sociální sítě');
     $form->addText('fb', 'Facebook');
     $form->addGroup('Lidé');
     $form->addManyToOne('coordinator', 'Koordinátor');
     $form->addManyToMany('members', 'Členové');
     $form->addManyToMany('supporters', 'Přiznivci');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
Example #22
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addManyToOne('page', 'Stránka');
     $form->addText('itemsPerPage', 'Počet transakcí')->addRule($form::INTEGER);
     $form->addSaveButton('Save');
 }
Example #23
0
 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('name', 'Name');
     $form->addManyToOne('parent', 'Parent')->setPrompt('root');
     $form->addSaveButton('Save');
 }