public function initialize()
 {
     $this->_action = 'menuitem_add';
     $name = new Text('name');
     $name->setFilters(array('striptags', 'string'));
     $name->setAttributes(array('class' => 'form-control', 'autocomplete' => 'off', 'id' => 'menuitem_name'));
     $name->setLabel('Name');
     $url = new Text('url');
     $url->setFilters(array('striptags', 'string'));
     $url->setAttributes(array('class' => 'form-control', 'autocomplete' => 'off'));
     $url->setLabel('URL');
     $icon = new Text('icon');
     $icon->setFilters(array('striptags', 'string'));
     $icon->setAttributes(array('class' => 'form-control', 'autocomplete' => 'off'));
     $icon->setLabel('Icon');
     $device = new Select('device_id', Devices::find(), array('using' => array('id', 'name'), 'useEmpty' => true, 'emptyText' => 'None', 'emptyValue' => 0));
     $device->setLabel('Device');
     $menuId = new Hidden('menu_id');
     $menuId->setDefault(1);
     $this->add($name);
     $this->add($url);
     $this->add($icon);
     $this->add($device);
     $this->add($menuId);
 }
 /**
  * Add all fields to the form and set form specific attributes.
  */
 public function initialize()
 {
     $this->_action = 'general';
     $title = new Text('title');
     $title->setLabel('Title');
     $title->setFilters(array('striptags', 'string'));
     $title->setAttributes(array('class' => 'form-control'));
     $title->setDefault($this->_config->application->title);
     $title->addValidators(array(new PresenceOf(array())));
     $cryptKey = new Text('cryptkey');
     $cryptKey->setLabel('Cryptkey');
     $cryptKey->setFilters(array('striptags', 'string'));
     $cryptKey->setAttributes(array('class' => 'form-control'));
     $cryptKey->setDefault($this->_config->application->phalconCryptKey);
     $cryptKey->addValidators(array(new PresenceOf(array())));
     $bgcolor = new Select('bgcolor', array('blackbg' => 'Black', 'whitebg' => 'White'), array('useEmpty' => false));
     $bgcolor->setLabel('Background color');
     $bgcolor->setDefault($this->_config->application->background);
     $debug = new Check('debug');
     $debug->setLabel('debug');
     $debug->setAttributes(array('checked' => $this->_config->application->debug == '1' ? 'checked' : null));
     $this->add($title);
     $this->add($bgcolor);
     $this->add($cryptKey);
     $this->add($debug);
 }
 public function initialize($entity = null, $options = null)
 {
     $city = new Select('cityid', City::find(), array('using' => array('id', 'city'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione una Ciudad')));
     $city->setLabel('Ciudad');
     $this->add($city);
     $township = new Text('township');
     $township->setLabel('Sector');
     $this->add($township);
     $countryvalue = "";
     $statevalue = "";
     $city = "";
     if (isset($entity)) {
         if ($entity->getCity()) {
             $countryvalue = $entity->getCity()->getCountry()->getCountry();
             $statevalue = $entity->getCity()->getState()->getState();
         }
     }
     $country = new Text('country');
     $country->setLabel('País');
     $country->setDefault($countryvalue);
     $this->add($country);
     $state = new Text('state');
     $state->setDefault($statevalue);
     $state->setLabel('Estado');
     $this->add($state);
 }
 public function initialize()
 {
     $this->_action = 'devices_add';
     $name = new Text('name');
     $name->setLabel('Devicename');
     $name->setFilters(array('striptags', 'string'));
     $name->setAttributes(array('class' => 'form-control', 'autocomplete' => 'off'));
     $ip = new Text('ip');
     $ip->setLabel('IP');
     $ip->setFilters(array('striptags', 'string'));
     $ip->setAttributes(array('class' => 'form-control', 'autocomplete' => 'off'));
     $mac = new Text('mac');
     $mac->setLabel('MAC');
     $mac->setFilters(array('striptags', 'string'));
     $mac->setAttributes(array('class' => 'form-control', 'autocomplete' => 'off'));
     $webtemp = new Text('webtemp');
     $webtemp->setLabel('Webtemp path');
     $webtemp->setFilters(array('striptags', 'string'));
     $webtemp->setAttributes(array('class' => 'form-control', 'autocomplete' => 'off'));
     $shutdownMethod = new Select('shutdown_method', array('none' => 'None', 'rpc' => 'RPC'), array('useEmpty' => false));
     $shutdownMethod->setLabel('Shutdown method');
     $showDasboard = new Check('show_on_dashboard');
     $showDasboard->setLabel('Show on dashboard');
     $showDasboard->setAttributes(array('class' => 'form-control'));
     $this->add($name);
     $this->add($ip);
     $this->add($mac);
     $this->add($webtemp);
     $this->add($shutdownMethod);
     $this->add($showDasboard);
 }
Beispiel #5
0
 /**
  * Initialize the products form
  */
 public function initialize($entity = null, $options = array())
 {
     /*======================= usuario_id ================================*/
     if (!isset($options['edit'])) {
         $element = new Text("usuario_id");
         $this->add($element->setLabel("Id"));
     } else {
         $this->add(new Hidden("usuario_id"));
     }
     /*======================= usuario_nick ================================*/
     $name = new Text("name");
     $name->setLabel("Name");
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Name is required'))));
     $this->add($name);
     /*======================= usuario_nombreCompleto ================================*/
     $type = new Select('product_types_id', ProductTypes::find(), array('using' => array('id', 'name'), 'useEmpty' => true, 'emptyText' => '...', 'emptyValue' => ''));
     $type->setLabel('Type');
     $this->add($type);
     /*======================= usuario_contrasenia ================================*/
     $price = new Text("price");
     $price->setLabel("Price");
     $price->setFilters(array('float'));
     $price->addValidators(array(new PresenceOf(array('message' => 'Price is required')), new Numericality(array('message' => 'Price is required'))));
     $this->add($price);
     /*======================= usuario_sector ================================*/
     /*======================= usuario_email ================================*/
     /*======================= usuario_activo ================================*/
     /*======================= usuario_fechaCreacion ================================*/
     /*======================= usuario_imagen ================================*/
 }
 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);
 }
 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);
 }
Beispiel #8
0
 public function initialize($entity = null, $options = array())
 {
     /*Si el form es de creacion, los campos seran required. Viceversa.*/
     $required['clave'] = "";
     $required['valor'] = "";
     if (isset($options['required'])) {
         $required['clave'] = "required";
         $required['valor'] = "true";
     }
     /*=========================== ID =====================================*/
     if (!isset($options['edit'])) {
         $element = new Text("yacimiento_id");
         $this->add($element->setLabel("ID"));
     } else {
         $this->add(new Hidden("yacimiento_id"));
     }
     /*=========================== Destino =====================================*/
     $elemento = new Text('yacimiento_destino', array('maxlength' => 60, 'class' => 'form-control', $required['clave'] => $required['valor']));
     $elemento->setLabel('Destino');
     $elemento->setFilters(array('striptags', 'string'));
     $elemento->addValidators(array(new PresenceOf(array('message' => 'El destino es requerido'))));
     $this->add($elemento);
     /*=========================== Operadoras =====================================*/
     $elemento = new Select('operadora_yacimientoId', Operadora::find(array('operadora_habilitado=1 AND operadora_yacimientoId=NULL', 'order' => 'operadora_nombre')), array('using' => array('operadora_id', 'operadora_nombre'), 'useEmpty' => true, 'emptyText' => 'SELECCIONE LAS OPERADORAS', 'emptyValue' => '', 'class' => 'form-control autocompletar', 'style' => 'width:100%', 'multiple' => 'multiple', $required['clave'] => $required['valor']));
     $elemento->setLabel('Operadoras');
     $this->add($elemento);
     /*=========================== EquipoPozo =====================================*/
     $elemento = new Select('equipoPozo_yacimientoId', Equipopozo::find(array('equipoPozo_habilitado=1 AND equipoPozo_yacimientoId=NULL', 'order' => 'equipoPozo_nombre')), array('using' => array('equipoPozo_id', 'equipoPozo_nombre'), 'useEmpty' => true, 'emptyText' => 'SELECCIONE LOS EQUIPOS/POZOS', 'emptyValue' => '', 'class' => 'form-control autocompletar', 'style' => 'width:100%', 'multiple' => 'multiple', $required['clave'] => $required['valor']));
     $elemento->setLabel('Equipos/Pozos');
     $this->add($elemento);
 }
Beispiel #9
0
 public function initialize()
 {
     $name = new Text("name");
     $name->setLabel('Name');
     $name->addValidator(new PresenceOf(['message' => '<strong>Name</strong> is required.']));
     $this->add($name);
     $adapter = new Select("adapter", ['Mysql' => 'MySQL']);
     $adapter->setLabel('DB type');
     $this->add($adapter);
     $host = new Text("host");
     $host->setLabel('DB host');
     $host->addValidator(new PresenceOf(['message' => '<strong>DB host</strong> is required.']));
     $this->add($host);
     $user = new Text("username");
     $user->setLabel('DB user');
     $user->addValidator(new PresenceOf(array('message' => '<strong>DB user</strong> is required.')));
     $this->add($user);
     $pass = new Text("password");
     $pass->setLabel('DB pass');
     $this->add($pass);
     $dbname = new Text("dbname");
     $dbname->setLabel('DB name');
     $dbname->addValidator(new PresenceOf(array('message' => '<strong>DB name</strong> is required.')));
     $this->add($dbname);
     //$this->setCsrf();
 }
 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);
 }
 public function initialize($entity = null, $options = null)
 {
     $role = new Select('roleid', Role::find(), array('using' => array('id', 'role'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un Rol')));
     $role->setLabel('Rol');
     $this->add($role);
     //añadimos un botón de tipo submit
     $submit = $this->add(new Submit('Guardar', array('class' => 'btn btn-success')));
 }
 /**
  * Initialize the products form
  */
 public function initialize($entity = null, $options = array())
 {
     $produto_detalhes = new Select("produto_detalhes", array('0' => 'Não', '1' => 'Sim'));
     $produto_detalhes->setLabel('produto detalhes ?');
     $this->add($produto_detalhes);
     $produto_cubagem_detalhe = new Select("produto_cubagem_detalhe", array('0' => 'Não', '1' => 'Sim'));
     $produto_cubagem_detalhe->setLabel('Cubagem no detalhe ?');
     $this->add($produto_cubagem_detalhe);
 }
Beispiel #13
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);
     }
 }
Beispiel #14
0
 public function initialize($entity = null, $options = null)
 {
     $country = new Select('countryid', Country::find(), array('using' => array('id', 'country'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un País')));
     $country->setLabel('País');
     $this->add($country);
     $state = new Text('state');
     $state->setLabel('Estado');
     $this->add($state);
     //añadimos un botón de tipo submit
     $submit = $this->add(new Submit('Guardar', array('class' => 'btn btn-success')));
 }
 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);
 }
Beispiel #16
0
 public function initialize($entity = null, $options = null)
 {
     $restaurant = new Select('restaurantid', Restaurant::find(), array('using' => array('id', 'name'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un Restaurante')));
     $restaurant->setLabel('Pais');
     $this->add($restaurant);
     $name = new Text('name');
     $name->setLabel('Name');
     $this->add($name);
     $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);
 }
Beispiel #17
0
 public function initialize()
 {
     $email = new Text("email");
     $email->setLabel('Email');
     $email->addValidator(new PresenceOf(['message' => '<strong>Email</strong> address is required.']));
     $this->add($email);
     $type = new Select('type', ['master' => 'master', 'operator' => 'operator']);
     $type->setLabel('Type');
     $type->setDefault('operator');
     $this->add($type);
     //$this->setCsrf();
 }
 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)
 {
     $language = new Select('languagecode', Language::find(), array('using' => array('code', 'language'), 'useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un idioma')));
     $language->setLabel('Idioma');
     $this->add($language);
     $key = new Text('translatekey');
     $key->setLabel('Llave');
     $this->add($key);
     $value = new Text('translatevalue');
     $value->setLabel('Valor');
     $this->add($value);
 }
Beispiel #20
0
 /**
  * Initialize the cliente form
  */
 public function initialize($entity = null, $options = array())
 {
     $required['clave'] = "";
     $required['valor'] = "";
     if (isset($options['required'])) {
         $required['clave'] = "required";
         $required['valor'] = "true";
     }
     /*======================= ID ==============================*/
     if (!isset($options['edit'])) {
         $element = new Text("cliente_id");
         $this->add($element->setLabel("N° de Cliente"));
     } else {
         $this->add(new Text("cliente_id"));
     }
     $this->add(new Select("cliente_nombre", Cliente::find(), array('using' => array('cliente_id', 'cliente_nombre'), 'useEmpty' => true, 'class' => 'form-control ', 'style' => 'width:100%', $required['clave'] => $required['valor'])));
     /*======================= YACIMIENTO ==============================*/
     $elemento = new Select('yacimiento_id', Yacimiento::find(array('yacimiento_habilitado=1', 'order' => 'yacimiento_destino')), array('using' => array('yacimiento_id', 'yacimiento_destino'), 'useEmpty' => false, 'class' => 'form-control autocompletar', 'style' => 'width:100%', $required['clave'] => $required['valor']));
     $elemento->setLabel('Destino');
     $this->add($elemento);
     /*======================= LINEA ==============================*/
     $elemento = new Select('cliente_lineaId', Linea::find(array('linea_habilitado=1', 'order' => 'linea_nombre')), array('using' => array('linea_id', 'linea_nombre'), 'useEmpty' => false, 'class' => 'form-control autocompletar', 'style' => 'width:100%', $required['clave'] => $required['valor']));
     $elemento->setLabel('Linea');
     $this->add($elemento);
     /*======================= CENTRO COSTO ==============================*/
     $elemento = new Select('centroCosto_id', Centrocosto::find(array('centroCosto_habilitado=1', 'order' => 'centroCosto_codigo')), array('using' => array('centroCosto_id', 'centroCosto_codigo'), 'useEmpty' => false, 'class' => 'form-control autocompletar', 'style' => 'width:100%', $required['clave'] => $required['valor']));
     $elemento->setLabel('Centro de Costo');
     $this->add($elemento);
     /*======================= CLIENTE_OPERADORA ==============================*/
     //Todas Las Operadoras Dependientes:
     $listaOperadoras = new Select('cliente_lisneaId', array(array('placeholder' => 'SELECCIONE LA OPERADORA', 'maxlength' => 50, 'class' => 'form-control', $required['clave'] => $required['valor']), Operadora::find(array('operadora_habilitado=1', 'order' => 'operadora_nombre')), array('operadora_id', 'operadora_nombre'), 'operadora_id'));
     $listaOperadoras->setLabel('Operadora');
     $this->add($listaOperadoras);
     /*======================= CLIENTE - EQUIPO/POZO - YACIMIENTO ==============================*/
     //Primero El PRINCIPAL.
     $listaYacimiento = new Select('yacimiento_destino', array(array('placeholder' => 'SELECCIONAR', 'maxlength' => 50, 'class' => 'form-control', $required['clave'] => $required['valor']), Yacimiento::find(array('yacimiento_habilitado=1', 'order' => 'yacimiento_destino')), array('yacimiento_id', 'yacimiento_destino'), 'yacimiento_id'));
     $listaYacimiento->setLabel('Yacimiento');
     $this->add($listaYacimiento);
     /*=================================================*/
     $listaEquipoPozo = new Select('equipoPozo_nombre', array(array('placeholder' => 'SELECCIONE UN YACIMENTO', 'maxlength' => 50, 'class' => 'form-control', $required['clave'] => $required['valor']), Equipopozo::find(array('equipoPozo_habilitado=1', 'order' => 'equipoPozo_nombre')), array('equipoPozo_id', 'equipoPozo_nombre'), 'equipoPozo_id'));
     $listaEquipoPozo->setLabel('Equipo/Pozo');
     $this->add($listaEquipoPozo);
     /*======================== CLIENTE - CENTRO COSTO - LINEA =========================*/
     //DataList Dependientes: Linea
     $listaLinea = new Select('linea_nombre', array(array('placeholder' => 'SELECCIONAR', 'maxlength' => 50, 'class' => 'form-control'), Linea::find(array('linea_habilitado=1', 'order' => 'linea_nombre')), array('linea_id', 'linea_nombre'), 'linea_id'));
     $listaLinea->setLabel('Linea');
     $this->add($listaLinea);
     /*=================================================*/
     $listaCentroCosto = new Select('centroCosto_codigo', array(array('placeholder' => 'SELECCIONE UNA LINEA', 'maxlength' => 50, 'class' => 'form-control', $required['clave'] => $required['valor']), Centrocosto::find(array('centroCosto_habilitado=1', 'order' => 'centroCosto_codigo')), array('centroCosto_id', 'centroCosto_codigo'), 'centroCosto_id'));
     $listaCentroCosto->setLabel('Centro Costo');
     $this->add($listaCentroCosto);
 }
Beispiel #21
0
 public function initialize()
 {
     // Company
     $company = new Select('companyid', Company::find(), array('using' => array('id', 'name')));
     $company->setLabel('Empresa');
     $this->add($company);
     $number = new Text('name');
     $number->setLabel('Número de Torre');
     $number->addValidators(array(new PresenceOf(array('message' => 'Debe ingresar un numero de torre'))));
     $this->add($number);
     //añadimos un botón de tipo submit
     $submit = $this->add(new Submit('save', array('class' => 'btn btn-success')));
 }
 /**
  * Initialize the products form
  */
 public function initialize($model = null, $options = array())
 {
     $nome = new Text("nome");
     $nome->setLabel("Nome");
     $nome->setFilters(array('striptags', 'string'));
     $nome->setAttribute('class', 'form-control');
     $this->add($nome);
     if (is_null($model)) {
         $categoria = new Select("parent", Categorias::returnArrayForSelect(), array('using' => array('_id', 'nome'), 'useEmpty' => true, 'emptyText' => 'Nenhuma', 'emptyValue' => ''));
         $categoria->setLabel("Selecione a categoria pai*");
         $categoria->setAttribute('class', 'form-control');
         $this->add($categoria);
     }
 }
 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);
 }
 function set_empty_values()
 {
     $state = new Select('stateid', array(), array('useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un Estado')));
     $state->setLabel('state');
     $this->add($state);
     $city = new Select('cityid', array(), array('useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione una Ciudad')));
     $city->setLabel('city');
     $this->add($city);
     $township = new Select('townshipid', array(), array('useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un Sector')));
     $township->setLabel('Sector');
     $this->add($township);
     $neighborhood = new Select('neighborhoodid', array(), array('useEmpty' => TRUE, 'emptyText' => $this->di->get('translate')->_('Seleccione un Sector')));
     $neighborhood->setLabel('Barrio');
     $this->add($neighborhood);
 }
 public function initialize($entity = null, $options = null)
 {
     $extension = new Text('extension');
     $extension->setLabel('Extension');
     $this->add($extension);
     $type = new Select("type", array('image' => $this->di->get('translate')->_('Image'), 'video' => $this->di->get('translate')->_('Video'), 'document' => $this->di->get('translate')->_('Document'), 'other' => $this->di->get('translate')->_('Other')));
     $type->setLabel('Type');
     $this->add($type);
     $mimetype = new Text('mimetype');
     $mimetype->setLabel('Mime type');
     $this->add($mimetype);
     $accept = new Select("accept", array('T' => $this->di->get('translate')->_('Yes'), 'F' => $this->di->get('translate')->_('No')));
     $accept->setLabel('Accept');
     $this->add($accept);
 }
Beispiel #26
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();
 }
 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);
 }
 public function initialize($entity = null, $options = null)
 {
     $code = new Text('code');
     $code->setLabel('Código');
     $this->add($code);
     $language = new Text('language');
     $language->setLabel('Idioma');
     $this->add($language);
     $language = new Text('language');
     $language->setLabel('Idioma');
     $this->add($language);
     $flag = new Select("flag", $this->get_country_flags(), array("useEmpty" => true, "emptyText" => $this->di->get('translate')->_('Seleccione una bandera')));
     $flag->setLabel('Bandera');
     $this->add($flag);
 }
 public function initialize()
 {
     // Company
     $company = new Select('companyid', Company::find(), array('using' => array('id', 'name')));
     $company->setLabel('Company');
     $this->add($company);
     $tower = new Select('towerid', array('0' => 'Select a tower'));
     $tower->setLabel('Tower');
     $this->add($tower);
     $name = new Text('name');
     $name->setLabel('Apartment Name');
     $name->addValidators(array(new PresenceOf(array('message' => 'You must enter an apartment name'))));
     $this->add($name);
     //añadimos un botón de tipo submit
     $submit = $this->add(new Submit('save', array('class' => 'btn btn-success')));
 }
 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);
 }