예제 #1
0
 public function initialize()
 {
     $type = new Select('type', Publication::$types, array());
     $type->setLabel('Тип пубикации');
     $this->add($type);
     $title = new Text('title', array('required' => true));
     $title->setLabel('Название');
     $this->add($title);
     $slug = new Text('slug');
     $slug->setLabel('Транслитерация');
     $this->add($slug);
     $date = new Text('date');
     $date->setLabel('Дата публикации');
     $this->add($date);
     $text = new TextArea('text');
     $text->setLabel('Текст');
     $this->add($text);
     $meta_title = new Text('meta_title', array('required' => true));
     $meta_title->setLabel('meta-title');
     $this->add($meta_title);
     $meta_description = new TextArea('meta_description');
     $meta_description->setLabel('meta-description');
     $this->add($meta_description);
     $meta_keywords = new TextArea('meta_keywords');
     $meta_keywords->setLabel('meta-keywords');
     $this->add($meta_keywords);
     $preview_inner = new Check('preview_inner');
     $preview_inner->setLabel('Превью внутри публикации');
     $preview_inner->setDefault(1);
     $this->add($preview_inner);
     $image = new File('image');
     $image->setLabel('Загрузить превью');
     $this->add($image);
 }
 function initialize($entity = null, $options = null)
 {
     $date = new Date('date');
     $date->setLabel('Input Date');
     $date->setFilters(array('striptags', 'string'));
     $date->setDefault(date('Y-m-d'));
     $date->addValidators(array(new PresenceOf(array('message' => 'Date is required'))));
     $this->add($date);
     $start_time = new Text('start_hour');
     $start_time->setLabel('Input Start Hour');
     $start_time->setFilters(array('striptags', 'string'));
     $start_time->addValidators(array(new PresenceOf(array('message' => 'Start Time is required'))));
     $this->add($start_time);
     $finish_time = new Text('finish_hour');
     $finish_time->setLabel('Input Finish Hour');
     $finish_time->setFilters(array('striptags', 'string'));
     $finish_time->addValidators(array(new PresenceOf(array('message' => 'Finish Time is required'))));
     $this->add($finish_time);
     $systemId = new Select('system_id', Systems::find(), array('using' => array('id', 'name'), 'useEmpty' => true));
     $systemId->setLabel('Select System');
     $systemId->addValidators(array(new PresenceOf(array('message' => 'System is required'))));
     if ($entity) {
         $systemId->setDefault(array($entity->system_id));
     }
     $this->add($systemId);
     $description = new TextArea('description');
     $description->setLabel('Input Description');
     $description->addValidators(array(new PresenceOf(array('message' => 'Description is required'))));
     $this->add($description);
     $hidden = new Hidden('id');
     if ($entity) {
         $hidden->setDefault(array($entity->id));
     }
     $this->add($hidden);
 }
 /**
  * Initialize the products form
  */
 public function initialize($entity = null, $options = array())
 {
     $f = new TextArea("institucional");
     $f->setLabel('&nbsp');
     $f->setAttribute('class', 'form-control summernote');
     $this->add($f);
 }
예제 #4
0
 public function initialize()
 {
     $type = new Select('type_id', Type::cachedListArray(['key' => 'id']));
     $type->setLabel('Type of Publication');
     $this->add($type);
     $title = new Text('title', ['required' => true]);
     $title->addValidator(new PresenceOf(['message' => 'Title can not be empty']));
     $title->setLabel('Title');
     $this->add($title);
     $slug = new Text('slug');
     $slug->setLabel('Slug');
     $this->add($slug);
     $date = new Text('date');
     $date->setLabel('Publication Date');
     $this->add($date);
     $text = new TextArea('text');
     $text->setLabel('Text');
     $this->add($text);
     $meta_title = new Text('meta_title', ['required' => true]);
     $meta_title->setLabel('meta-title');
     $this->add($meta_title);
     $meta_description = new TextArea('meta_description', ['style' => 'height:4em; min-height: inherit']);
     $meta_description->setLabel('meta-description');
     $this->add($meta_description);
     $meta_keywords = new TextArea('meta_keywords', ['style' => 'height:4em; min-height: inherit']);
     $meta_keywords->setLabel('meta-keywords');
     $this->add($meta_keywords);
     $preview_inner = new Check('preview_inner');
     $preview_inner->setLabel('Show preview image inside publication');
     $this->add($preview_inner);
     $image = new Image('preview_src');
     $image->setLabel('Thumbnail Image');
     $this->add($image);
 }
 /**
  * Initialize the products form
  */
 public function initialize($entity = null, $options = array())
 {
     $titulo = new Text("titulo");
     $titulo->setAttribute('class', 'form-control ');
     $this->add($titulo);
     $email = new Text("email");
     $email->setAttribute('class', 'form-control ');
     $this->add($email);
     $telefone = new Text("telefone");
     $telefone->setAttribute('class', 'form-control ');
     $this->add($telefone);
     $endereco = new Text("endereco");
     $endereco->setAttribute('class', 'form-control ');
     $this->add($endereco);
     $cep = new Text("cep");
     $cep->setLabel('CEP');
     $cep->setAttribute('data-mask', '99999-999');
     $cep->setAttribute('class', 'form-control ');
     $this->add($cep);
     $descricao = new TextArea("descricao");
     $descricao->setLabel('Descrição da loja');
     $descricao->setAttribute('class', 'form-control ');
     $descricao->setAttribute('rows', '5');
     $this->add($descricao);
     $produtos_por_pagina = new Numeric("produtos_por_pagina");
     $produtos_por_pagina->setLabel('Produtos por pagina');
     $produtos_por_pagina->setAttribute('class', 'form-control');
     $this->add($produtos_por_pagina);
     $produtos_destaque_quantidade = new Numeric("produtos_destaque");
     $produtos_destaque_quantidade->setLabel('Produtos destaques');
     $produtos_destaque_quantidade->setAttribute('class', 'form-control');
     $this->add($produtos_destaque_quantidade);
 }
예제 #6
0
 /**
  * @param Phalcon\Mvc\ModelInstance $entity
  * @param array $options
  */
 public function initialize($entity = null, $options = null)
 {
     if (!isset($options['edit']) && !isset($options['create'])) {
         $id = new Text('id');
         $id->setLabel('Id');
         $this->add($id);
     }
     $category = new Select('categoriesId', Categories::find(), array('using' => array('id', 'name'), 'useEmpty' => true, 'emptyText' => '...'));
     $category->setLabel('Category');
     $category->addValidator(new PresenceOf(array('message' => 'Category is mandatory')));
     $category->setUserOption('searcheable', true);
     $category->setUserOption('browseable', true);
     $category->setUserOption('relation', 'category');
     $this->add($category);
     $icon = new Text('icon', array('placeholder' => 'Enter a css-icon class name'));
     $icon->setLabel('Icon');
     $icon->addValidator(new PresenceOf(array('message' => 'Icon is mandatory')));
     $this->add($icon);
     $code = new Text('code', array('maxlength' => 10));
     $code->setLabel('Code');
     $code->setUserOption('searcheable', true);
     $code->setUserOption('browseable', true);
     $code->addValidator(new PresenceOf(array('message' => 'Code is mandatory')));
     $this->add($code);
     $name = new Text('name', array('maxlength' => 64));
     $name->setLabel('Name');
     $name->setUserOption('searcheable', true);
     $name->setUserOption('browseable', true);
     $name->addValidator(new PresenceOf(array('message' => 'Name is mandatory')));
     $this->add($name);
     $description = new TextArea('description');
     $description->setLabel('Description');
     $description->addValidator(new PresenceOf(array('message' => 'Description is mandatory')));
     $this->add($description);
     $price = new Text('price');
     $price->setLabel('Price');
     $price->setUserOption('searcheable', true);
     $price->setUserOption('browseable', true);
     $price->addValidator(new PresenceOf(array('message' => 'Price is mandatory')));
     $price->addValidator(new Numericality(array('message' => 'Price must be a number')));
     $this->add($price);
     $stock = new Text('stock');
     $stock->setLabel('Stock');
     $stock->setUserOption('browseable', true);
     $stock->addValidator(new PresenceOf(array('message' => 'Current stock is mandatory')));
     $stock->addValidator(new Numericality(array('message' => 'Current stock must be a number')));
     $this->add($stock);
     if (isset($options['edit'])) {
         $createdAt = new Date('created', array('readonly' => 'readonly'));
         $createdAt->setLabel('Created At');
         if ($entity->createdAt) {
             $entity->created = date('Y-m-d', $entity->createdAt);
         }
         $this->add($createdAt);
     }
 }
 public function initialize()
 {
     $type = new Radio('type', ['1' => '单选/多选', '3' => '判断']);
     $type->setLabel('题目类型');
     $type->addValidators([new PresenceOf(['message' => '题目类型必选'])]);
     $this->add($type);
     $question = new TextArea('question');
     $question->setLabel('题目');
     $question->addValidators([new PresenceOf(['message' => '题目内容必填'])]);
     $this->add($question);
 }
예제 #8
0
 public function initialize($entity = null, $options = array())
 {
     $name = new Text('name', array('placeholder' => 'Name'));
     $name->setLabel('Name');
     $name->addValidators(array(new PresenceOf(array('message' => 'Please enter your name')), new StringLength(array('max' => 50, 'min' => 2, 'messageMaximum' => 'Name must have at most 50 characters', 'messageMinimum' => 'Name must have at least 2 characters'))));
     $this->add($name);
     $description = new TextArea('description', array('placeholder' => 'Description'));
     $description->setLabel('Description');
     $description->addValidators(array(new PresenceOf(array('message' => 'Please enter your description')), new StringLength(array('max' => 1000, 'min' => 5, 'messageMaximum' => 'Description must have at most 1000 characters', 'messageMinimum' => 'Name must have at least 5 characters'))));
     $this->add($description);
 }
 public function initialize($entity = null, $options = null)
 {
     $language = new Select('languagecode', Language::find(), array('using' => array('code', 'language'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Select a Language')));
     $language->setLabel('Idioma');
     $this->add($language);
     $title = new Text('title');
     $title->setLabel('Title');
     $this->add($title);
     $content = new TextArea('content', array('id' => 'summernote', 'name' => 'content', 'class' => 'summernote'));
     $content->setLabel('Content');
     $this->add($content);
 }
 public function initialize($entity = null, $options = null)
 {
     $code = new Text('code');
     $code->setLabel('Code');
     $this->add($code);
     $parameter = new Text('parameter');
     $parameter->setLabel('Parameter');
     $this->add($parameter);
     $textvalue = new TextArea('textvalue');
     $textvalue->setLabel('Value');
     $this->add($textvalue);
 }
 function initialize($entity = null, $options = null)
 {
     $name = new Text('name');
     $name->setLabel('Input Module');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Name is required'))));
     $this->add($name);
     $description = new TextArea('description');
     $description->setLabel('Input Description');
     $description->addValidators(array(new PresenceOf(array('message' => 'Description is required'))));
     $this->add($description);
 }
 public function initialize($entity = null, $options = null)
 {
     $language = new Select('languagecode', Language::find(), array('using' => array('code', 'language'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Select a Language')));
     $language->setLabel('Idioma');
     $this->add($language);
     $name = new Text('name');
     $name->setLabel('Name translation');
     $this->add($name);
     $description = new TextArea('description');
     $description->setLabel('Description translation');
     $this->add($description);
 }
예제 #13
0
 /**
  * Initialize the products form
  */
 public function initialize($entity = null, $options = array())
 {
     $f = new TextArea("meta_description");
     $f->setLabel('Meta Description');
     $f->setAttribute('class', 'form-control');
     $f->setAttribute('rows', '10');
     $this->add($f);
     $f = new TextArea("meta_keyword");
     $f->setLabel('Meta Keywords');
     $f->setAttribute('class', 'form-control');
     $f->setAttribute('rows', '10');
     $this->add($f);
 }
예제 #14
0
 public function initialize()
 {
     $id = new Text("id");
     $id->addValidator(new PresenceOf(array('message' => 'ID должен быть указан')));
     $id->addValidator(new Regex(array('pattern' => '/[a-z0-9_-]+/i', 'message' => 'В ID могут быть только символы a-z 0-9 _ -')));
     $id->setLabel('ID');
     $title = new Text("title");
     $title->setLabel('Название');
     $html = new TextArea("html");
     $html->setLabel('HTML');
     $this->add($id);
     $this->add($title);
     $this->add($html);
 }
예제 #15
0
 public function initialize()
 {
     $id = new Text("id");
     $id->addValidator(new PresenceOf(array('message' => 'ID can not be empty.')));
     $id->addValidator(new Regex(array('pattern' => '/[a-z0-9_-]+/i', 'message' => 'В ID must be a-z 0-9 _ -')));
     $id->setLabel('ID');
     $title = new Text("title");
     $title->setLabel('Title');
     $html = new TextArea("html");
     $html->setLabel('HTML');
     $this->add($id);
     $this->add($title);
     $this->add($html);
 }
예제 #16
0
 /**
  * Initialize the products form
  */
 public function initialize($entity = null, $options = array())
 {
     $f = new text("aws_bucket");
     $f->setLabel('AWS Bucket');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("aws_id");
     $f->setLabel('AWS ID');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("aws_location");
     $f->setLabel('AWS LOCATION');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("aws_secret_key");
     $f->setLabel('AWS SECRET KEY');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("facebook_appId");
     $f->setLabel('Facebook app id');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("facebook_appSecret");
     $f->setLabel('Facebooke app secret');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("sendgrid_username");
     $f->setLabel('Sendgrid username');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("sendgrid_password");
     $f->setLabel('sendgrid password');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new text("sendgrid_templateId");
     $f->setLabel('sendgrid template ID');
     $f->setAttribute('class', 'form-control');
     $this->add($f);
     $f = new TextArea("mapa");
     $f->setLabel('Google Maps');
     $f->setAttribute('class', 'form-control');
     $f->setAttribute('rows', '10');
     $this->add($f);
     $f = new TextArea("chat");
     $f->setLabel('Chat');
     $f->setAttribute('class', 'form-control');
     $f->setAttribute('rows', '10');
     $this->add($f);
 }
예제 #17
0
 public function initialize()
 {
     $name = new Text("name");
     $name->setLabel('Name');
     $name->addValidator(new PresenceOf(array('message' => '<strong>Name</strong> is required.')));
     $this->add($name);
     $format = new Select("format", ['CSV' => 'Standard CSV', 'Excel' => 'Micosoft Excel (.xlsx)']);
     $format->setLabel('File format');
     $this->add($format);
     $qry = new TextArea("qry");
     $qry->setLabel('Query');
     $qry->addValidator(new PresenceOf(array('message' => '<strong>Query</strong> is required.')));
     $this->add($qry);
     //$this->setCsrf();
 }
예제 #18
0
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('name');
     $name->setLabel('Nombre');
     $this->add($name);
     $title = new Text('title');
     $title->setLabel('Título');
     $this->add($title);
     $type = new Select("type", array('image' => 'Imagen', 'video' => 'Video', 'mix' => 'Mixta'));
     $type->setLabel('Tipo');
     $this->add($type);
     $description = new TextArea('description');
     $description->setLabel('Descripción');
     $this->add($description);
 }
예제 #19
0
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('name');
     $name->setLabel('Name');
     $this->add($name);
     $type = new Text('type');
     $type->setLabel('type');
     $this->add($type);
     $size = new Text('size');
     $size->setLabel('size');
     $this->add($size);
     $path = new TextArea('path');
     $path->setLabel('Path');
     $this->add($path);
 }
예제 #20
0
 public function initialize($entity = null, $options = null)
 {
     $title = new Text('title', array('class' => 'form-control'));
     $title->setLabel('Title');
     $this->add($title);
     $author = new Text('author', array('class' => 'form-control'));
     $author->setLabel('Author');
     $this->add($author);
     $content = new TextArea('content', array('id' => 'summernote', 'name' => 'content', 'class' => 'summernote'));
     $content->setLabel('Content');
     $this->add($content);
     $active = new Select("active", array('Y' => $this->di->get('translate')->_('Yes'), 'N' => $this->di->get('translate')->_('No')), array('class' => 'form-control'));
     $active->setLabel('active');
     $this->add($active);
 }
예제 #21
0
 public function initalize($entity = null, $options = array())
 {
     if (!isset($options['edit'])) {
         $element = new Text("id");
         $this->add($element->setLabel("id"));
     } else {
         $this->add(new Hidden("id"));
     }
     $dte = new Hidden("date_added", array('id' => 'date_added', 'value' => date("Y-m-d H:i:s")));
     $this->add($dte);
     $title = new MyText("title", array('id' => 'title'));
     $title->setLabel("title");
     $this->add($title);
     $msg = new TextArea("text", array('id' => 'text', 'class' => 'form-control'));
     $msg->setLabel("Message");
     $this->add($msg);
 }
 public function initialize($entity = null, $options = null)
 {
     $article = new Select('articleid', Article::find(), array('using' => array('id', 'title'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Select an Article'), 'class' => 'form-control'));
     $article->setLabel('Article');
     $this->add($article);
     $name = new Text('name', array('class' => 'form-control'));
     $name->setLabel('Name');
     $this->add($name);
     $email = new Text('email', array('class' => 'form-control'));
     $email->setLabel('Email');
     $this->add($email);
     $comment = new TextArea('comment', array('id' => 'summernote', 'name' => 'comment', 'class' => 'summernote'));
     $comment->setLabel('Comment');
     $this->add($comment);
     $active = new Select("active", array('Y' => $this->di->get('translate')->_('Yes'), 'N' => $this->di->get('translate')->_('No')), array('class' => 'form-control'));
     $active->setLabel('active');
     $this->add($active);
 }
예제 #23
0
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('name');
     $name->setLabel('Name');
     $this->add($name);
     $location = new Text('location');
     $location->setLabel('Location');
     $this->add($location);
     $start_date = new Text('start_date');
     $start_date->setLabel('Start Date');
     $this->add($start_date);
     $finish_date = new Text('finish_date');
     $finish_date->setLabel('Finish Date');
     $this->add($finish_date);
     $description = new TextArea('description');
     $description->setLabel('Descripción');
     $this->add($description);
 }
예제 #24
0
 public function initialize($entity = null, $options = array())
 {
     if (!isset($options['edit'])) {
         $id = new Text('id');
         $this->add($id->setLabel("Id"));
     } else {
         $id = new Hidden('id');
         $this->add($id);
     }
     $name = new Text('name');
     $name->setLabel('简称');
     $this->add($name);
     $fullName = new Text('fullName');
     $fullName->setLabel('全称');
     $this->add($fullName);
     $engName = new Text("engName");
     $engName->setLabel('英文名称');
     $this->add($engName);
     $address = new Text('address');
     $address->setLabel('机构地址');
     $this->add($address);
     $level = new Select('level', About::getLevels());
     $level->setLabel('级别');
     $this->add($level);
     $category = new Select('category', About::getCategories());
     $category->setLabel('分类');
     $this->add($category);
     $contacts = new Text('contacts');
     $contacts->setLabel('业务联系人');
     $this->add($contacts);
     $phone = new Text('phone');
     $phone->setLabel('联系人电话');
     $this->add($phone);
     $email = new Text('email');
     $email->setLabel('邮箱');
     $this->add($email);
     $intro = new TextArea('intro');
     $intro->setLabel('简介');
     $this->add($intro);
     $create_at = new Text('create_at');
     $create_at->setLabel('建馆日期');
     $this->add($create_at);
 }
예제 #25
0
 public function initialize()
 {
     // phone
     $phone = new Text('phone');
     $phone->setLabel('电话');
     $phone->setFilters(array('striptags', 'string'));
     $phone->addValidators(array(new PresenceOf(array('message' => 'phone is required'))));
     $this->add($phone);
     // Email
     $email = new Text('email');
     $email->setLabel('邮件');
     $email->setFilters('email');
     $this->add($email);
     $message = new TextArea('msg');
     $message->setLabel('建议');
     $message->setFilters(array('striptags', 'string'));
     $message->addValidators(array(new PresenceOf(array('message' => 'message is required'))));
     $this->add($message);
 }
예제 #26
0
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('name');
     $name->setLabel('Nombre');
     $this->add($name);
     $phone = new Text('phone');
     $phone->setLabel('Phone');
     $this->add($phone);
     $address = new TextArea("rest_address");
     $address->setLabel('Address');
     $this->add($address);
     $addressid = new Hidden('addressid');
     $this->add($addressid);
     $email = new Text("email");
     $email->setLabel('email');
     $this->add($email);
     $website = new Text("website");
     $website->setLabel('website');
     $this->add($website);
 }
예제 #27
0
 public function initialize($entity = null, $options = null)
 {
     // Name
     $name = new Text('name');
     $name->setLabel('Your Name');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Name is required'))));
     $this->add($name);
     // Email
     $email = new Text('email');
     $email->setLabel('E-Mail');
     $email->setFilters('email');
     $email->addValidators(array(new PresenceOf(array('message' => 'E-mail is required')), new Email(array('message' => 'E-mail is not valid'))));
     $this->add($email);
     $comments = new TextArea('comments');
     $comments->setLabel('Comments');
     $comments->setFilters(array('striptags', 'string'));
     $comments->addValidators(array(new PresenceOf(array('message' => 'Comments is required'))));
     $this->add($comments);
 }
예제 #28
0
 public function initialize($entity = null, $options = array())
 {
     $name = new Text('name', array('maxlength' => 100, 'placeholder' => 'Nombre del sub-tema', 'required' => 'required', 'class' => 'form-control', 'autofocus' => 'autofocus', 'id' => 'name'));
     $name->setLabel("*Nombre del sub-tema");
     $name->addValidator(new SpaceValidatorForm(array('message' => 'El campo nombre se encuentra vacío')));
     $name->addValidator(new StringLength(array('min' => 2, 'messageMinimum' => 'El nombre del sub-tema es demasiado corto, debe tener al menos 2 carateres', 'max' => 800, 'messageMaximum' => 'El nombre del sub-tema es demasiado largo, debe tener máximo 800 carateres')));
     $this->add($name);
     $description = new TextArea('description', array('maxlength' => 100, 'placeholder' => 'Descripción', 'class' => 'form-control', 'rows' => 5, 'id' => 'description'));
     $description->setLabel("Descripción");
     $this->add($description);
     $checked = "checked";
     $value = "1";
     if ($entity) {
         $checked = $entity->status ? "checked" : "";
         $value = $entity->status;
     }
     $status = new Check('status', array('id' => 'status', 'class' => 'onoffswitch-checkbox', "value" => $value, $checked => $checked));
     $status->setLabel("*Estado");
     $this->add($status);
 }
예제 #29
0
 public function initialize($entity = null, $options = null)
 {
     $category = new Select('categoryid', DishCategory::find(), array('using' => array('id', 'category'), 'useEmpty' => TRUE, 'emptyText' => 'Seleccione una Categoria'));
     $category->setLabel('Category');
     $this->add($category);
     $gallery = new Select('galleryid', Gallery::find(), array('using' => array('id', 'name'), 'useEmpty' => TRUE, 'emptyText' => 'Seleccione una galeria'));
     $gallery->setLabel('Galeria');
     $this->add($gallery);
     $name = new Text('name');
     $name->setLabel('Name');
     $this->add($name);
     $price = new Text('price');
     $price->setLabel('Price');
     $this->add($price);
     $image_path = new Text('image_path');
     $image_path->setLabel('Image');
     $this->add($image_path);
     $description = new TextArea('description');
     $description->setLabel('Description');
     $this->add($description);
 }
예제 #30
-1
 function initialize($entity = null, $options = null)
 {
     $date = new Date('date_found');
     $date->setLabel('Input Date Found');
     $date->setFilters(array('striptags', 'string'));
     $this->add($date);
     /*====================== Number =====================*/
     $number = new Text('number');
     $number->setLabel('Input Number');
     $number->setFilters(array('striptags', 'string'));
     $number->addValidators(array(new PresenceOf(array('message' => 'Number is required'))));
     $this->add($number);
     /*====================== Solved =====================*/
     $isSolved = new Radio('is_solved', array('name' => 'is_solved', 'value' => '1'));
     $isSolved->setLabel('Is Solved');
     $isSolved->addValidators(array(new PresenceOf(array('message' => 'Is solved is required'))));
     $this->add($isSolved);
     $isSolved2 = new Radio('is_solved2', array('name' => 'is_solved', 'value' => '0', 'checked' => TRUE));
     $isSolved2->setLabel('Is Solved2');
     $isSolved2->addValidators(array(new PresenceOf(array('message' => 'Is solved is required'))));
     $this->add($isSolved2);
     $systemId = new Select('system_id', Systems::find(), array('using' => array('id', 'name'), 'useEmpty' => true));
     $systemId->setLabel('Select System');
     $systemId->addValidators(array(new PresenceOf(array('message' => 'System is required'))));
     if ($entity) {
         $systemId->setDefault(array($entity->system_id));
     }
     $this->add($systemId);
     $modulesId = new Select('modules_id', Modules::find(), array('using' => array('id', 'name'), 'useEmpty' => true));
     $modulesId->setLabel('Select Modules');
     $modulesId->addValidators(array(new PresenceOf(array('message' => 'Modules is required'))));
     if ($entity) {
         $modulesId->setDefault(array($entity->modules_id));
     }
     $this->add($modulesId);
     /*===== Bug =============*/
     $systemId = new Select('system_id', Systems::find(), array('using' => array('id', 'name'), 'useEmpty' => true));
     $systemId->setLabel('Select System');
     $systemId->addValidators(array(new PresenceOf(array('message' => 'System is required'))));
     if ($entity) {
         $systemId->setDefault(array($entity->system_id));
     }
     $this->add($systemId);
     $description = new TextArea('description');
     $description->setLabel('Input Description');
     $description->addValidators(array(new PresenceOf(array('message' => 'Description is required'))));
     $this->add($description);
     $hidden = new Hidden('id');
     if ($entity) {
         $hidden->setDefault(array($entity->id));
     }
     $this->add($hidden);
 }