Example #1
0
 /**
  *
  * @param object $poView
  * @return string
  */
 public function render($poView = null)
 {
     $laMessage = $this->getFieldMessage();
     if ($this->getDataOptsVal('format-date', true)) {
         $this->_sValue = Translator::dateS2P($this->_sValue);
     }
     Layout::parseTemplate($this->_sTemplate, "#%COLLENGTH%#", $this->_nColLength);
     Layout::parseTemplate($this->_sTemplate, "#%FOR%#", $this->getOptsVal('for'));
     Layout::parseTemplate($this->_sTemplate, "#%LABEL%#", $this->getOptsVal('label'));
     Layout::parseTemplate($this->_sTemplate, "#%HELPICON%#", $this->getHelpArea());
     Layout::parseTemplate($this->_sTemplate, "#%REQUIREDICON%#", $this->getRequiredArea());
     Layout::parseTemplate($this->_sTemplate, "#%MSGICON%#", $this->getMessageArea($laMessage));
     Layout::parseTemplate($this->_sTemplate, "#%CLASSERROR%#", $laMessage['class']);
     Layout::parseTemplate($this->_sTemplate, "#%TYPE%#", $this->getAttrVal('type'));
     Layout::parseTemplate($this->_sTemplate, "#%ID%#", $this->getAttrVal('id'));
     Layout::parseTemplate($this->_sTemplate, "#%NAME%#", $this->_sName);
     Layout::parseTemplate($this->_sTemplate, "#%CLASS%#", $this->getAttrVal('class') . $laMessage['class']);
     Layout::parseTemplate($this->_sTemplate, "#%VALUE%#", $this->_sValue);
     Layout::parseTemplate($this->_sTemplate, "#%TITLE%#", $this->getAttrVal('title'));
     Layout::parseTemplate($this->_sTemplate, "#%PLACEHOLDER%#", $this->getAttrVal('placeholder'));
     Layout::parseTemplate($this->_sTemplate, "#%REQUIRED%#", $this->getAttrVal('required'));
     Layout::parseTemplate($this->_sTemplate, "#%READONLY%#", $this->getAttrVal('readonly'));
     Layout::parseTemplate($this->_sTemplate, "#%PATTERN%#", $this->getAttrVal('pattern'));
     Layout::parseTemplate($this->_sTemplate, "#%DATAMASK%#", $this->getAttrVal('data-mask'));
     Layout::parseTemplate($this->_sTemplate, "#%DATAMASKALT%#", $this->getAttrVal('data-maskalt'));
     Layout::parseTemplate($this->_sTemplate, "#%BTNID%#", $this->getDataOptsVal("id", $this->_sName . 'Btn'));
     Layout::parseTemplate($this->_sTemplate, "#%BTNTITLE%#", $this->getDataOptsVal('title', $this->getAttrVal('title')));
     Layout::parseTemplate($this->_sTemplate, "#%BTNCLASS%#", $this->getDataOptsVal("class", "btn btn-default"));
     Layout::parseTemplate($this->_sTemplate, "#%DATAICON%#", $this->getDataOptsVal("data-icon", "glyphicon glyphicon-calendar"));
     return $this->_sTemplate;
 }
Example #2
0
 public function __construct()
 {
     $this->_sTable = 'Company';
     $this->_sModule = 'Company';
     $this->_sRoute = 'company';
     $this->_sEntity = 'Company\\Entity\\CompanyBasic';
     $this->_sEntityExtended = 'Company\\Entity\\CompanyExtended';
     $this->_sForm = 'Company\\Form\\CompanyForm';
     $this->_sTitleS = Translator::i18n('Empresa');
     $this->_sTitleP = Translator::i18n('Empresas');
     $this->_aSearchFields = array('a.stName' => Translator::i18n('Razão Social'), 'a.stAliasName' => Translator::i18n('Empresa'), 'a.stArea' => Translator::i18n('Área'));
     $this->_sSearchFieldDefault = 'a.stName';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stName' => Translator::i18n('Razão Social'), 'stAliasName' => Translator::i18n('Empresa'), 'stRegistry' => Translator::i18n('Cadastro'), 'stArea' => Translator::i18n('Área'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stName', 'stAliasName', 'stRegistry', 'stArea');
     $this->_nGridNumRows = 12;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stName' => Translator::i18n('Razão Social'), 'stAliasName' => Translator::i18n('Empresa'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stName', 'stAliasName');
     $this->_sSearchLabelField = 'stName|stRegistry';
     $this->_nSearchGridNumRows = 6;
 }
Example #3
0
 public function __construct()
 {
     $this->_sTable = 'Country';
     $this->_sModule = 'Country';
     $this->_sRoute = 'country';
     $this->_sEntity = 'Country\\Entity\\CountryBasic';
     $this->_sEntityExtended = 'Country\\Entity\\CountryExtended';
     $this->_sForm = 'Country\\Form\\CountryForm';
     $this->_sTitleS = Translator::i18n('País');
     $this->_sTitleP = Translator::i18n('Países');
     $this->_aSearchFields = array('a.stCountry' => Translator::i18n('País'), 'a.stAbreviationISO3' => Translator::i18n('Sigla'));
     $this->_sSearchFieldDefault = 'a.stCountry';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stCountry' => Translator::i18n('País'), 'stAbreviationISO3' => Translator::i18n('Sigla'), 'stAbreviation ISO 2' => Translator::i18n('Sigla ISO2'), 'City' => Translator::i18n('Capital'), 'stLocale' => Translator::i18n('Idioma'), 'stTimeZone' => Translator::i18n('Time Zone'), Translator::i18n('Moeda'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stCountry', 'stAbreviationISO3', 'stAbreviationISO2', 'CityEstate', 'stLocale', 'stTimeZone', 'stCurrencyDef');
     $this->_nGridNumRows = 12;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stCountry' => Translator::i18n('País'), 'stAbreviationISO3' => Translator::i18n('Sigla'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stCountry', 'stAbreviationISO3');
     $this->_sSearchLabelField = 'stCountry';
     $this->_nSearchGridNumRows = 6;
 }
Example #4
0
 public function __construct()
 {
     $this->_sTable = 'Contact';
     $this->_sModule = 'Contact';
     $this->_sRoute = 'contact';
     $this->_sEntity = 'Contact\\Entity\\ContactBasic';
     $this->_sEntityExtended = 'Contact\\Entity\\ContactExtended';
     $this->_sForm = 'Contact\\Form\\ContactForm';
     $this->_sTitleS = Translator::i18n('Contato');
     $this->_sTitleP = Translator::i18n('Contatos');
     $this->_aSearchFields = array('a.stValue' => Translator::i18n('Contato'), 'a.stType' => Translator::i18n("Tipo"));
     $this->_sSearchFieldDefault = 'a.stValue';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stType' => Translator::i18n('Tipo'), 'stValue' => Translator::i18n('Contato'), Translator::i18n('Título'), Translator::i18n('Pessoa'), Translator::i18n('Principal'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stType', 'stValue', 'stLabel', 'stPerson', 'enumMasterContact');
     $this->_nGridNumRows = 12;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stType' => Translator::i18n('Tipo'), 'stValue' => Translator::i18n('Contato'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stType', 'stValue');
     $this->_sSearchLabelField = 'stValue';
     $this->_nSearchGridNumRows = 6;
 }
Example #5
0
 public function __construct()
 {
     $this->_sTable = 'Estate';
     $this->_sModule = 'Estate';
     $this->_sRoute = 'estate';
     $this->_sEntity = 'Estate\\Entity\\EstateBasic';
     $this->_sEntityExtended = 'Estate\\Entity\\EstateExtended';
     $this->_sForm = 'Estate\\Form\\EstateForm';
     $this->_sTitleS = Translator::i18n('Estado');
     $this->_sTitleP = Translator::i18n('Estados');
     $this->_aSearchFields = array('a.stEstate' => Translator::i18n('Estados'), 'a.stAbreviation' => Translator::i18n('Sigla'));
     $this->_sSearchFieldDefault = 'a.stEstate';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'Country' => Translator::i18n('País'), 'stEstate' => Translator::i18n('Estado'), 'stAbreviation' => Translator::i18n('Sigla'), 'City' => Translator::i18n('Capital'), Translator::i18n('Time Zone'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'CountryName', 'stEstate', 'stAbreviation', 'CityName', 'stTimeZone');
     $this->_nGridNumRows = 12;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stEstate' => Translator::i18n('Estado'), 'stAbreviation' => Translator::i18n('Sigla'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stEstate', 'stAbreviation');
     $this->_sSearchLabelField = 'stEstate';
     $this->_nSearchGridNumRows = 6;
 }
Example #6
0
 /**
  * 
  */
 public function __construct()
 {
     $this->_sTable = 'Person';
     $this->_sModule = 'Person';
     $this->_sRoute = 'person';
     $this->_sEntity = 'Person\\Entity\\PersonBasic';
     $this->_sEntityExtended = 'Person\\Entity\\PersonExtended';
     $this->_sForm = 'Person\\Form\\PersonForm';
     $this->_sTitleS = Translator::i18n('Pessoa');
     $this->_sTitleP = Translator::i18n('Pessoas');
     $this->_aSearchFields = array('a.stName' => Translator::i18n('Nome'), 'a.stCitizenId' => Translator::i18n('CPF'));
     $this->_sSearchFieldDefault = 'a.stName';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stName' => Translator::i18n('Nome'), 'enumGender' => Translator::i18n('Sexo'), 'dtBirthdate' => Translator::i18n('Dt. Nascimento'), 'stCitizenId' => Translator::i18n('CPF'));
     $this->_aGridAlign = array();
     $this->_aGridFields = array('id', 'stName', 'enumGender', 'dtBirthdate', 'stCitizenId');
     $this->_nGridNumRows = 12;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stName' => Translator::i18n('Nome'), 'stCitizenId' => Translator::i18n('CPF'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aSearchGridFields = array('id', 'stName', 'stCitizenId');
     $this->_sSearchLabelField = 'stName';
     $this->_nSearchGridNumRows = 6;
 }
Example #7
0
 public function __construct()
 {
     $this->_sTable = 'Street';
     $this->_sModule = 'Street';
     $this->_sRoute = 'street';
     $this->_sEntity = 'Street\\Entity\\StreetBasic';
     $this->_sEntityExtended = 'Street\\Entity\\StreetExtended';
     $this->_sForm = 'Street\\Form\\StreetForm';
     $this->_sTitleS = Translator::i18n('Logradouro');
     $this->_sTitleP = Translator::i18n('Logradouros');
     $this->_aSearchFields = array('a.stStreet' => Translator::i18n('Logradouro'), 'a.stNeighborhood' => Translator::i18n('Bairro'), 'a.ZipCode' => Translator::i18n('CEP'));
     $this->_sSearchFieldDefault = 'a.stStreet';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stType' => Translator::i18n('Tipo'), 'stStreet' => Translator::i18n('Logradouro'), 'stNeighborhood' => Translator::i18n('Bairro'), 'City' => Translator::i18n('Cidade'), Translator::i18n('País'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stType', 'stStreet', 'stNeighborhood', 'CityEstate', 'Country');
     $this->_nGridNumRows = 30;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stType' => Translator::i18n('Tipo'), 'stStreet' => Translator::i18n('Logradouro'), 'City' => Translator::i18n('Cidade'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stType', 'stStreet', 'CityEstate');
     $this->_sSearchLabelField = 'stStreet';
     $this->_nSearchGridNumRows = 6;
 }
Example #8
0
 public function __construct()
 {
     $this->_sTable = 'ZipCode';
     $this->_sModule = 'ZipCode';
     $this->_sRoute = 'zip-code';
     $this->_sEntity = 'ZipCode\\Entity\\ZipCodeBasic';
     $this->_sEntityExtended = 'ZipCode\\Entity\\ZipCodeExtended';
     $this->_sForm = 'ZipCode\\Form\\ZipCodeForm';
     $this->_sTitleS = Translator::i18n('CEP');
     $this->_sTitleP = Translator::i18n('CEPs');
     $this->_aSearchFields = array('a.stZipCode' => Translator::i18n('CEP'), 'a.City' => Translator::i18n('Cidade'), 'a.Estate' => Translator::i18n('Estado'), 'a.Country' => Translator::i18n('País'));
     $this->_sSearchFieldDefault = 'a.stZipCode';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stZipCode' => Translator::i18n('CEP'), 'City' => Translator::i18n('Cidade'), 'Estate' => Translator::i18n('Estado'), 'Country' => Translator::i18n('País'), Translator::i18n('Faixa Ini'), Translator::i18n('Faixa Fim'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stZipCode', 'CityName', 'EstateName', 'CountryName', 'stRangeIni', 'stRangeEnd');
     $this->_nGridNumRows = 12;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stZipCode' => Translator::i18n('CEP'), 'City' => Translator::i18n('Cidade'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stZipCode', 'CityEstate');
     $this->_sSearchLabelField = 'stZipCode';
     $this->_nSearchGridNumRows = 6;
 }
Example #9
0
 public function __construct()
 {
     $this->_sTable = 'Category';
     $this->_sModule = 'Category';
     $this->_sRoute = 'category';
     $this->_sEntity = 'Category\\Entity\\CategoryBasic';
     $this->_sEntityExtended = 'Category\\Entity\\CategoryExtended';
     $this->_sForm = 'Category\\Form\\CategoryForm';
     $this->_sTitleS = Translator::i18n('Categoria');
     $this->_sTitleP = Translator::i18n('Categorias');
     $this->_aSearchFields = array('a.stResource' => Translator::i18n('Recurso'), 'a.stValue' => Translator::i18n('Valor'));
     $this->_sSearchFieldDefault = 'a.stValue';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stResource' => Translator::i18n('Recurso'), Translator::i18n('Categoria Pai'), 'stValue' => Translator::i18n('Valor'), 'stLabel' => Translator::i18n('Título'), 'stLocale' => Translator::i18n('Língua'), 'dtInsert' => Translator::i18n('Cadastro'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stResource', 'CategoryLabel', 'stValue', 'stLabel', 'stLocale', 'dtInsert');
     $this->_nGridNumRows = 12;
     $this->_bSearch = false;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stResource' => Translator::i18n('Recurso'), 'stValue' => Translator::i18n('Valor'), 'stLabel' => Translator::i18n('Título'), 'stLocale' => Translator::i18n('Língua'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stResource', 'stValue', 'stLabel', 'stLocale');
     $this->_sSearchLabelField = 'stLabel';
     $this->_nSearchGridNumRows = 6;
 }
Example #10
0
 public function __construct()
 {
     parent::__construct('User', 'User\\Grid\\UserGrid');
     //$this->_sWindowType = 'default';
     //$this->_sResponse = 'html';
     $this->setTitle(Translator::i18n('Usuários'));
     $this->setDescription('Description');
     $this->setHelp('Help');
     $this->setIcon('user');
     $this->setShowSearch(true);
     $this->setSearchFieldDefault('stUsername');
     $this->setCheckType('checkbox');
     $this->setOrderCol('id');
     $this->setOrder('ASC');
     $this->setShowColOptions(true);
     $this->setPaginationNumRows(array('6', '12', '25', '50', '100'));
     $this->setNumRows(12);
     $this->setShowPaginationNumRows(true);
     $this->setShowPaginationInfo(true);
     $this->setShowPaginationNav(true);
     $this->createColumn('id')->setTitle(Translator::i18n('Id'))->setSortable(true)->setVisible(true)->setSearchable(true)->setResizable(true)->setWidth('3%')->setAlign('center');
     $this->createColumn('UserGroupName')->setOrdering('UserGroup')->setSearchable(false)->setSortable(true)->setTitle(Translator::i18n('Grupo'))->createButton('group-view')->setTitle(' ')->setIcon('eye-open')->setDescription('Clique para visualizar informações do grupo.')->setParams(array('data-act' => "/user-group/view/?id=#%UserGroup_id%#", 'data-title' => "Group", 'data-btnname' => "Ok", 'data-btndismiss' => "true"))->setClass('openDialogModalBtn')->setTarget('modal')->setResponse('html')->setRequest('ajax');
     $this->createColumn('stUsername')->setSearchable(false)->setSortable(true)->setTitle(Translator::i18n('Usuário'));
     $this->createColumn('PersonName')->setOrdering('Person')->setSearchable(false)->setSortable(true)->setTitle(Translator::i18n('Nome'))->createButton('person-view')->setTitle(' ')->setIcon('eye-open')->setDescription('Clique para visualizar informações da pessoa.')->setParams(array('data-act' => "/person/view/?id=#%Person_id%#", 'data-title' => "Person", 'data-btnname' => "Ok", 'data-btndismiss' => "true"))->setClass('openDialogModalBtn')->setTarget('modal')->setResponse('html')->setRequest('ajax');
     $this->createColumn('dtInsert')->setTitle(Translator::i18n('Cadastro'))->setSearchable(false)->setSortable(true);
     //$this->createColOptions('view');
     //$this->createColOptions('edit');
     $this->createColOptions('delete');
     return $this;
 }
Example #11
0
 public function __construct()
 {
     $this->_sTable = 'Address';
     $this->_sModule = 'Address';
     $this->_sRoute = 'address';
     $this->_sEntity = 'Address\\Entity\\AddressBasic';
     $this->_sEntityExtended = 'Address\\Entity\\AddressExtended';
     $this->_sForm = 'Address\\Form\\AddressForm';
     $this->_sTitleS = Translator::i18n('Endereço');
     $this->_sTitleP = Translator::i18n('Endereço');
     $this->_aSearchFields = array('a.stPlace' => Translator::i18n('Local'), 'a.Street' => Translator::i18n('Logradouro'), 'a.Estate' => Translator::i18n('Estado'), 'a.ZipCode' => Translator::i18n('CEP'));
     $this->_sSearchFieldDefault = 'a.stPlace';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stPlace' => Translator::i18n('Local'), 'Street' => Translator::i18n('Logradouro'), 'stNumber' => Translator::i18n('Número'), 'stComplement' => Translator::i18n('Complemento'), 'ZipCode' => Translator::i18n('CEP'), 'CityEstate' => Translator::i18n('Cidade'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stPlace', 'Street', 'stNumber', 'stComplement', 'ZipCode', 'CityEstate');
     $this->_nGridNumRows = 12;
     $this->_bSearch = false;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stPlace' => Translator::i18n('Local'), 'Street' => Translator::i18n('Logradouro'), 'stNumber' => Translator::i18n('Número'), 'stComplement' => Translator::i18n('Complemento'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stPlace', 'Street', 'stNumber', 'stComplement');
     $this->_sSearchLabelField = 'stPlace';
     $this->_nSearchGridNumRows = 6;
 }
Example #12
0
 public function __construct()
 {
     $this->_sTable = 'UserGroup';
     $this->_sModule = 'UserGroup';
     $this->_sRoute = 'user-group';
     $this->_sEntity = 'UserGroup\\Entity\\UserGroupBasic';
     $this->_sEntityExtended = 'UserGroup\\Entity\\UserGroupExtended';
     $this->_sForm = 'UserGroup\\Form\\UserGroupForm';
     $this->_sTitleS = Translator::i18n('Grupo de usuário');
     $this->_sTitleP = Translator::i18n('Grupos de usuário');
     $this->_aSearchFields = array('a.stLabel' => Translator::i18n('Apelido'), 'a.stName' => Translator::i18n('Grupo Id'), 'a.UserGroup' => Translator::i18n('Grupo Pai'));
     $this->_sSearchFieldDefault = 'a.stLabel';
     $this->_sGridOrderCol = 'id';
     $this->_sGridOrder = 'ASC';
     $this->_aGridCols = array('id' => Translator::i18n('Id'), 'stName' => Translator::i18n('Grupo Id'), 'stLabel' => Translator::i18n('Apelido'), 'UserGroup' => Translator::i18n('Grupo Pai'), 'dtInsert' => Translator::i18n('Cadastro'));
     $this->_aGridAlign = array();
     $this->_aGridWidth = array();
     $this->_aGridColor = array();
     $this->_aGridFields = array('id', 'stName', 'stLabel', 'UserGroupName', 'dtInsert');
     $this->_nGridNumRows = 12;
     $this->_bSearch = true;
     $this->_aSearchGridCols = array('id' => Translator::i18n('Id'), 'stName' => Translator::i18n('Grupo Id'), 'stLabel' => Translator::i18n('Apelido'), 'UserGroup' => Translator::i18n('Grupo Pai'));
     $this->_aSearchGridAlign = array();
     $this->_aSearchGridWidth = array();
     $this->_aSearchGridColor = array('', '#f6f6f6');
     $this->_aSearchGridFields = array('id', 'stName', 'stLabel', 'UserGroupName');
     $this->_sSearchLabelField = 'stLabel';
     $this->_nSearchGridNumRows = 6;
 }
Example #13
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $this->add(array('name' => 'stPhoneExtension', 'attributes' => array('id' => 'stPhoneExtension', 'type' => 'text', 'placeholder' => Translator::i18n('Novo ramal'), 'class' => 'form-control noUpper', 'required' => true, 'title' => Translator::i18n('Novo ramal'), 'data-mask' => '9999'), 'options' => array('label' => Translator::i18n('Novo ramal') . ': ', 'for' => 'stPhoneExtension')));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Alterar'), 'id' => 'submitbutton', 'class' => 'btn btn-primary ajaxSubmitBtn', 'data-form' => '#ChangePhoneExtension', 'data-container' => '#ChangePhoneExtensionContainer')));
     // Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #14
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'stType', 'type' => 'Select', 'attributes' => array('id' => 'stType', 'placeholder' => Translator::i18n('Type'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Type')), 'options' => array('label' => Translator::i18n('Type') . ': ', 'for' => 'stType', 'empty_option' => Translator::i18n('--- Select ---'), 'value_options' => array('email' => Translator::i18n('E-mail'), 'mobile' => Translator::i18n('Mobile'), 'line' => Translator::i18n('Line'), 'skype' => Translator::i18n('Skype'), 'whatsapp' => Translator::i18n('WhatsApp'), 'facebook' => Translator::i18n('Facebook'), 'twitter' => Translator::i18n('Twitter'), 'google+' => Translator::i18n('Google+')))));
     $this->add(array('name' => 'stLabel', 'attributes' => array('id' => 'stLabel', 'type' => 'text', 'placeholder' => Translator::i18n('Label'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Label')), 'options' => array('label' => Translator::i18n('Label') . ': ', 'for' => 'stLabel')));
     $this->add(array('name' => 'stValue', 'attributes' => array('id' => 'stValue', 'type' => 'text', 'placeholder' => Translator::i18n('Value'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Value')), 'options' => array('label' => Translator::i18n('Value') . ': ', 'for' => 'stValue')));
     $this->add(array('name' => 'stPerson', 'attributes' => array('id' => 'stPerson', 'type' => 'text', 'placeholder' => Translator::i18n('Person'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Person')), 'options' => array('label' => Translator::i18n('Person') . ': ', 'for' => 'stPerson')));
     $this->add(array('name' => 'enumMasterContact', 'type' => 'Select', 'attributes' => array('id' => 'enumMasterContact', 'placeholder' => Translator::i18n('Main contact'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Main contact')), 'options' => array('label' => Translator::i18n('Main contact') . ': ', 'for' => 'enumMasterContact', 'empty_option' => Translator::i18n('--- Select ---'), 'value_options' => array('0' => Translator::i18n('No'), '1' => Translator::i18n('Yes')))));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Save'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     //Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #15
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'stResource', 'type' => 'Select', 'attributes' => array('id' => 'stResource', 'title' => Translator::i18n('Módulo que irá utilizar as categorias'), 'class' => 'form-control noUpper', 'required' => true), 'options' => array('label' => Translator::i18n('Recurso') . ': ', 'for' => 'stResource', 'length' => 6, 'empty_option' => Translator::i18n('--- Selecione ---'), 'value_options' => array())));
     $this->add(array('name' => 'Category_id', 'attributes' => array('id' => 'Category_id', 'type' => 'hidden', 'required' => false)));
     $this->add(array('name' => 'CategoryLabel', 'attributes' => array('id' => 'CategoryLabel', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Categoria pai'), 'required' => false), 'options' => array('label' => Translator::i18n('Categoria pai') . ': ', 'for' => 'CategoryLabel', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Selecione a categoria'), 'data-btn' => Translator::i18n('Selecione'), 'data-act' => '/category/search-select', 'data-return' => 'Category_id'))));
     $this->add(array('name' => 'stValue', 'attributes' => array('id' => 'stValue', 'type' => 'text', 'title' => Translator::i18n(''), 'class' => 'form-control noUpper', 'required' => true, 'placeholder' => Translator::i18n('')), 'options' => array('label' => Translator::i18n('Valor') . ': ', 'for' => 'stValue', 'length' => 6)));
     $this->add(array('name' => 'stLabel', 'attributes' => array('id' => 'stLabel', 'type' => 'text', 'title' => Translator::i18n('Título para o valor'), 'class' => 'form-control noUpper', 'required' => true, 'placeholder' => Translator::i18n('Título para o valor')), 'options' => array('label' => Translator::i18n('Título') . ': ', 'for' => 'stLabel', 'length' => 6)));
     $this->add(array('name' => 'stLocale', 'type' => 'Select', 'attributes' => array('id' => 'stLocale', 'title' => Translator::i18n('Língua'), 'class' => 'form-control noUpper', 'required' => true, 'value' => 'pt-br'), 'options' => array('label' => Translator::i18n('Língua') . ': ', 'for' => 'stLocale', 'length' => 6, 'empty_option' => Translator::i18n('--- Selecione ---'), 'value_options' => array())));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Save'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     // Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #16
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'stLabel', 'attributes' => array('id' => 'stLabel', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Identificação'), 'required' => true), 'options' => array('label' => Translator::i18n('Identificação') . ': ', 'for' => 'stLabel')));
     $this->add(array('name' => 'stResource', 'attributes' => array('id' => 'stResource', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Módulo'), 'required' => true), 'options' => array('label' => Translator::i18n('Módulo') . ': ', 'for' => 'stResource')));
     $this->add(array('name' => 'stAction', 'attributes' => array('id' => 'stAction', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Ação'), 'required' => true), 'options' => array('label' => Translator::i18n('Ação') . ': ', 'for' => 'stAction')));
     $this->add(array('name' => 'Resource_id', 'attributes' => array('id' => 'Resource_id', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Registro'), 'required' => false, 'data-mask' => '999999999999'), 'options' => array('label' => Translator::i18n('Registro') . ': ', 'for' => 'Resource_id')));
     $this->add(array('name' => 'stEmail', 'attributes' => array('id' => 'stEmail', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('E-mail'), 'required' => false), 'options' => array('label' => Translator::i18n('E-mail') . ': ', 'for' => 'stEmail')));
     $this->add(array('name' => 'stName', 'attributes' => array('id' => 'stName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Nome'), 'required' => false), 'options' => array('label' => Translator::i18n('Nome') . ': ', 'for' => 'stName')));
     $this->add(array('name' => 'txtMessage', 'attributes' => array('id' => 'txtMessage', 'type' => 'textarea', 'class' => 'form-control', 'title' => Translator::i18n('Mensagem'), 'required' => false), 'options' => array('label' => Translator::i18n('Mensagem') . ': ', 'for' => 'txtMessage')));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Salvar & Enviar e-mail'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     // Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #17
0
    /**
     * 
     * @return string
     */
    public function renderModal()
    {
        $lsModal = '
			<div id="onionGridModalConfirmation" class="onion-grid-modal modal fade bs-example-modal-lg hidden-print" tabindex="-1" role="dialog" aria-labelledby="onionGridModalConfirmationLabel" aria-hidden="true">
				<div class="modal-dialog modal-lg">
			    	<div class="modal-content">
			      		<div class="modal-header">
			        		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			        		<h4 class="modal-title" id="onionGridModalConfirmationLabel">' . Translator::i18n('Confirmação') . '</h4>
			      		</div>
			      		<div class="modal-body">
			      		</div>
			      		<div class="modal-footer">
			        		<button type="button" class="btn btn-default" data-dismiss="modal">' . Translator::i18n('Fechar') . '</button>
			        		<button id="onionModalConfirmBtn" type="button" class="btn btn-primary" data-dismiss="modal">' . Translator::i18n('Confirmar') . '</button>
			        	</div>
			    	</div>
			  	</div>
			</div>';
        return $lsModal;
    }
Example #18
0
 public function getInputFilter()
 {
     $loInputFilter = new InputFilter();
     $loInputFilter->setForm($this);
     $loFactory = new InputFactory();
     $loInputFilter->add($loFactory->createInput(array('name' => 'stUsername', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => Translator::i18n('Login deve conter de 5 a 100 caracteres válidos!')))), array('name' => 'StringLength', 'options' => array('encoding' => 'UTF-8', 'min' => 5, 'max' => 100, 'messages' => array('stringLengthTooShort' => Translator::i18n('Login muito curto, mínimo 5 caractéres!'), 'stringLengthTooLong' => Translator::i18n('Login muito longo, máximo 100 caractéres!'))))))));
     $loInputFilter->add($loFactory->createInput(array('name' => 'stPassword', 'required' => true, 'filters' => array(array('name' => 'StripTags'), array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => Translator::i18n('Senha inválida, ela deve ter de 6 a 25 caractéres, contendo números (0-9), letras maiúsculas (A-Z) e minúsculas (a-z)!')))), array('name' => 'regex', 'options' => array('pattern' => '/^.*(?=.{6,25})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', 'messages' => array('regexInvalid' => Translator::i18n('Senha inválida, ela deve ter de 6 a 25 caractéres, contendo números (0-9), letras maiúsculas (A-Z) e minúsculas (a-z)!'), 'regexNotMatch' => Translator::i18n('Senha inválida, ela deve ter de 6 a 25 caractéres, contendo números (0-9), letras maiúsculas (A-Z) e minúsculas (a-z)!'))))))));
     return $loInputFilter;
 }
Example #19
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'stName', 'attributes' => array('id' => 'stName', 'type' => 'text', 'placeholder' => Translator::i18n('Razão social'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Razão social')), 'options' => array('label' => Translator::i18n('Razão social') . ': ', 'for' => 'stName')));
     $this->add(array('name' => 'stAliasName', 'attributes' => array('id' => 'stAliasName', 'type' => 'text', 'placeholder' => Translator::i18n('Empresa'), 'class' => 'form-control', 'title' => Translator::i18n('Empresa')), 'options' => array('label' => Translator::i18n('Empresa') . ': ', 'for' => 'stAliasName')));
     $this->add(array('name' => 'stRegistry', 'attributes' => array('id' => 'stRegistry', 'type' => 'text', 'placeholder' => Translator::i18n('CNPJ'), 'class' => 'form-control', 'title' => Translator::i18n('CNPJ'), 'data-mask' => '000.000.000/0000-00'), 'options' => array('label' => Translator::i18n('CNPJ') . ': ', 'for' => 'stRegistry')));
     $this->add(array('name' => 'stRegistry2', 'attributes' => array('id' => 'stRegistry2', 'type' => 'text', 'placeholder' => Translator::i18n('Inscrição estadual'), 'class' => 'form-control', 'title' => Translator::i18n('Inscrição estadual')), 'options' => array('label' => Translator::i18n('Inscrição estadual') . ': ', 'for' => 'stRegistry2')));
     $this->add(array('name' => 'stArea', 'type' => 'Select', 'attributes' => array('id' => 'stArea', 'placeholder' => Translator::i18n('Área'), 'class' => 'form-control', 'title' => Translator::i18n('Área')), 'options' => array('label' => Translator::i18n('Área') . ': ', 'for' => 'stArea', 'empty_option' => Translator::i18n('--- Selecionar ---'), 'value_options' => array('factory' => Translator::i18n('Factory')))));
     $this->add(array('name' => 'stDescription', 'attributes' => array('id' => 'stDescription', 'type' => 'text', 'placeholder' => Translator::i18n('Descrição'), 'class' => 'form-control', 'title' => Translator::i18n('Descrição')), 'options' => array('label' => Translator::i18n('Descrição') . ': ', 'for' => 'stDescription')));
     $this->add(array('name' => 'stKeywords', 'attributes' => array('id' => 'stKeywords', 'type' => 'text', 'placeholder' => Translator::i18n('Palavras chave'), 'class' => 'form-control', 'title' => Translator::i18n('Palavras chave')), 'options' => array('label' => Translator::i18n('Palavras chave') . ': ', 'for' => 'stKeywords')));
     $this->add(array('name' => 'stLink', 'attributes' => array('id' => 'stLink', 'type' => 'text', 'placeholder' => Translator::i18n('Link'), 'class' => 'form-control', 'title' => Translator::i18n('Link')), 'options' => array('label' => Translator::i18n('Link') . ': ', 'for' => 'stLink')));
     $this->add(array('name' => 'stLogoPath', 'attributes' => array('id' => 'stLogoPath', 'type' => 'text', 'placeholder' => Translator::i18n('Logo'), 'class' => 'form-control', 'title' => Translator::i18n('Logo')), 'options' => array('label' => Translator::i18n('Logo') . ': ', 'for' => 'stLogoPath')));
     $this->add(array('name' => 'Contacts', 'attributes' => array('id' => 'Contacts', 'type' => 'hidden', 'required' => true)));
     $this->add(array('name' => 'ContactsName', 'attributes' => array('id' => 'ContactsName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Contato'), 'required' => true), 'options' => array('label' => Translator::i18n('Contato') . ': ', 'for' => 'ContactsName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Selecione o contato'), 'data-btn' => Translator::i18n('Selecione'), 'data-act' => '/contact/search-select', 'data-return' => 'Contacts', 'data-select' => 'multipe'))));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Salvar'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     //Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #20
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'stZipCode', 'attributes' => array('id' => 'stZipCode', 'type' => 'text', 'placeholder' => Translator::i18n('Zip Code'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Zip Code')), 'options' => array('label' => Translator::i18n('ZipCode') . ': ', 'for' => 'stZipCode')));
     $this->add(array('name' => 'stRangeIni', 'attributes' => array('id' => 'stRangeIni', 'type' => 'text', 'placeholder' => Translator::i18n('Range Init'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Range Init')), 'options' => array('label' => Translator::i18n('Range Init') . ': ', 'for' => 'stRangeIni')));
     $this->add(array('name' => 'stRangeEnd', 'attributes' => array('id' => 'stRangeEnd', 'type' => 'text', 'placeholder' => Translator::i18n('Range End'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Range End')), 'options' => array('label' => Translator::i18n('Range End') . ': ', 'for' => 'stRangeEnd')));
     $this->add(array('name' => 'Country_id', 'attributes' => array('id' => 'Country_id', 'type' => 'hidden', 'required' => true)));
     $this->add(array('name' => 'CountryName', 'attributes' => array('id' => 'CountryName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Country'), 'required' => true), 'options' => array('label' => Translator::i18n('Country') . ': ', 'for' => 'CountryName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Select Country'), 'data-btn' => Translator::i18n('Select'), 'data-act' => '/country/search-select', 'data-return' => 'Country_id'))));
     $this->add(array('name' => 'Estate_id', 'attributes' => array('id' => 'Estate_id', 'type' => 'hidden', 'required' => true)));
     $this->add(array('name' => 'EstateName', 'attributes' => array('id' => 'EstateName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Estate'), 'required' => true), 'options' => array('label' => Translator::i18n('Estate') . ': ', 'for' => 'EstateName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Select Estate'), 'data-btn' => Translator::i18n('Select'), 'data-act' => '/estate/search-select', 'data-return' => 'Estate_id'))));
     $this->add(array('name' => 'City_id', 'attributes' => array('id' => 'City_id', 'type' => 'hidden', 'required' => true)));
     $this->add(array('name' => 'CityName', 'attributes' => array('id' => 'CityName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('City'), 'required' => true), 'options' => array('label' => Translator::i18n('City') . ': ', 'for' => 'CityName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Select City'), 'data-btn' => Translator::i18n('Select'), 'data-act' => '/city/search-select', 'data-return' => 'City_id'))));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Salvar'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     //Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #21
0
 public function getInputFilter()
 {
     $loInputFilter = new InputFilter();
     $loInputFilter->setForm($this);
     $loFactory = new InputFactory();
     $loInputFilter->add($loFactory->createInput(array('name' => 'stEmail', 'required' => true, 'validators' => array(array('name' => 'EmailAddress', 'options' => array('messages' => array('emailAddressInvalidHostname' => Translator::i18n('Hostname inválido!'), 'hostnameInvalidHostname' => Translator::i18n('Hostname inválido!'), 'hostnameLocalNameNotAllowed' => Translator::i18n('Hostname inválido!')))), array('name' => 'DoctrineModule\\Validator\\ObjectExists', 'options' => array('object_repository' => $this->getObjectManager()->getRepository($this->_sEntity), 'fields' => 'stEmail', 'messages' => array('noObjectFound' => Translator::i18n('E-mail não registrado!'))))))));
     return $loInputFilter;
 }
Example #22
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'City_id', 'attributes' => array('id' => 'City_id', 'type' => 'hidden', 'required' => true)));
     $this->add(array('name' => 'CityName', 'attributes' => array('id' => 'CityName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('City'), 'required' => true), 'options' => array('label' => Translator::i18n('City') . ': ', 'for' => 'CityName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Select City'), 'data-btn' => Translator::i18n('Select'), 'data-act' => '/city/search-select', 'data-return' => 'City_id'))));
     $this->add(array('name' => 'stType', 'type' => 'Select', 'attributes' => array('id' => 'stType', 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Type')), 'options' => array('label' => Translator::i18n('Type') . ': ', 'for' => 'stType', 'empty_option' => Translator::i18n('--- Select ---'), 'value_options' => array('street' => Translator::i18n('Street'), 'avenue' => Translator::i18n('Avenue'), 'square' => Translator::i18n('Square'), 'lane' => Translator::i18n('Lane'), 'highway' => Translator::i18n('Highway'), 'roadhway' => Translator::i18n('Roadway'), 'road' => Translator::i18n('Road'), 'village' => Translator::i18n('Village'), 'alley' => Translator::i18n('Alley')))));
     $this->add(array('name' => 'stStreet', 'attributes' => array('id' => 'stStreet', 'type' => 'text', 'placeholder' => Translator::i18n('Street name'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Street')), 'options' => array('label' => Translator::i18n('Street') . ': ', 'for' => 'stStreet')));
     $this->add(array('name' => 'stNeighborhood', 'attributes' => array('id' => 'stNeighborhood', 'type' => 'text', 'placeholder' => Translator::i18n('Neighborhood name'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Neighborhood')), 'options' => array('label' => Translator::i18n('Neighborhood') . ': ', 'for' => 'stNeighborhood')));
     $this->add(array('name' => 'stLatitude', 'attributes' => array('id' => 'stLatitude', 'type' => 'text', 'placeholder' => Translator::i18n('Latitude coordenate'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Latitude')), 'options' => array('label' => Translator::i18n('Latitude') . ': ', 'for' => 'stLatitude')));
     $this->add(array('name' => 'stLongitude', 'attributes' => array('id' => 'stLongitude', 'type' => 'text', 'placeholder' => Translator::i18n('Longitude coordenate'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Longitude')), 'options' => array('label' => Translator::i18n('Longitude') . ': ', 'for' => 'stLongitude')));
     $this->add(array('name' => 'stZoomMap', 'type' => 'Number', 'attributes' => array('id' => 'stZoomMap', 'placeholder' => Translator::i18n('Choose a zoom map between 1 to 10'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Zoom Map'), 'min' => '0', 'max' => '10', 'step' => '1'), 'options' => array('label' => Translator::i18n('Zoom Map') . ': ', 'for' => 'stZoomMap')));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Save'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     // Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #23
0
 /**
  * Verify if the PHP version is right.
  *
  * @throws Exception
  */
 public function testPhpVersion()
 {
     // Checking the PHP version installed
     if (version_compare(phpversion(), self::PHP_VERSION_REQUIRED, '<') === true) {
         header('HTTP/1.1 500 Internal Server Error', true, 500);
         throw new Exception(sprintf(Translator::i18n('Your PHP version is %s. <br/> This application requere PHP %s or latest.'), phpversion(), self::PHP_VERSION_REQUIRED), 500);
     }
 }
Example #24
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'fromName', 'type' => 'Text', 'attributes' => array('id' => 'fromName', 'placeholder' => 'Seu Nome', 'class' => 'form-control', 'required' => true, 'title' => 'Seu nome', 'size' => '250'), 'options' => array('label' => 'Nome: ', 'for' => 'fromName')));
     $this->add(array('name' => 'fromMail', 'type' => 'Email', 'attributes' => array('id' => 'fromMail', 'pattern' => '^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,4})$', 'placeholder' => 'E-mail de contato', 'class' => 'form-control', 'required' => true, 'title' => 'Seu e-mail para contato', 'size' => '250'), 'options' => array('label' => 'E-mail: ', 'for' => 'fromMail')));
     /*
     $this->add(
     		array(
     			'name' => 'fromPhone',
     			'type' => 'Text',
     			'attributes' => array(
     				'id' => 'fromPhone',
     				'pattern'  => '^\([0-9]{2}\)[\s][0-9]{4,5}-[0-9]{4}',
     				'placeholder' => '(  )     -',
     				'class' => 'form-control',
     				'required' => true,
     				'title' => 'Seu telefone para contato',
     				'data-mask' => '(00) 0000-00009',
     				'data-maskalt' => '(00) 00000-0000',
     			),
     			'options' => array(
     				'label' => 'Telefone: ',
     				'for' => 'fromPhone'
     			)
     		));
     */
     $this->add(array('name' => 'subject', 'type' => 'Select', 'attributes' => array('id' => 'subject', 'class' => 'form-control', 'required' => true, 'title' => '', 'value' => ''), 'options' => array('label' => 'Assunto: ', 'for' => 'subject', 'empty_option' => '--- Escolha ---', 'value_options' => array('Contato' => 'Contato', 'Dúvida' => 'Dúvida', 'Reclamação' => 'Reclamação', 'Sugestão' => 'Sugestão'))));
     $this->add(array('name' => 'message', 'type' => 'textarea', 'attributes' => array('id' => 'message', 'placeholder' => 'Escreva sua mensagem aqui', 'class' => 'form-control', 'rows' => 6, 'required' => true, 'title' => ''), 'options' => array('label' => 'Mensagem: ', 'for' => 'message')));
     //$loCaptchaImg = new CaptchaImage();
     $loCaptchaImg = new Dumb();
     $loCaptcha = new Captcha('captcha');
     $loCaptcha->setCaptcha($loCaptchaImg);
     $loCaptcha->setAttributes(array('id' => 'captcha', 'class' => 'form-control', 'required' => false, 'title' => ''));
     $loCaptcha->setOptions(array('label' => 'Informe os caracteres: ', 'for' => 'captcha'));
     //$this->add($loCaptcha);
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'type' => 'Submit', 'attributes' => array('value' => Translator::i18n('Enviar'), 'id' => 'submit', 'class' => 'btn btn-primary')));
     //Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #25
0
    /**
     * 
     * @param array $paParams
     * @param string $psMark
     * @return string
     */
    public function renderSelectGrid(array $paParams = array(), $psMark = 'radio')
    {
        list($laResults, $loPagination, $lnRows, $lsQuery, $lsField, $laOrder, $lsUrl, $lsLabelField, $lsWindow, $lsFilter, ) = $paParams;
        $laData = $loPagination->get('aData');
        $lnCurrent = $laData['total'] == 0 ? '0' : $laData['current'];
        $lsGrid = '<link href="/vendor/m3uzz/onionjs-0.16.4/dist/css/grid.css" media="all" rel="stylesheet" type="text/css">';
        $lsGrid .= '
		<div id="gridSearchContent">';
        $lsGrid .= '
		 	<form id="actFormSearch" action="#" method="POST" data-request="AJAX">
		 		<input type="hidden" name="ckd" />
				<input type="hidden" name="col" value="' . $laOrder['col'] . '" />
				<input type="hidden" name="ord" value="' . $laOrder['ord'] . '" />
				<input type="hidden" name="rows" value="' . $lnRows . '" />
				<input type="hidden" name="p" value="' . $lnCurrent . '" />
				<input type="hidden" name="q" value="' . $lsQuery . '" />
				<input type="hidden" name="f" value="' . $lsField . '" />
				<input type="hidden" name="st" value="' . $psMark . '" />
				<input type="hidden" name="w" value="' . $lsWindow . '" />
				<input type="hidden" name="filter" value="' . $lsFilter . '" />
			</form>';
        //TODO: automatizar toolbar
        $lsGrid .= '
			<nav class="navbar navbar-inverse" role="navigation">
				<div class="container-fluid">';
        if ($this->_bSearchAddButton) {
            $lsGrid .= '
					<ul class="nav navbar-nav">
						<li>
							<a class="openPopUpBtn" href="#" data-url="/' . $this->_sRoute . '/add" data-params="" data-wname="' . $this->_sRoute . '-add" data-wheight="80%" data-wwidth="80%" title="' . Translator::i18n('Adicionar novo') . ' ' . $this->_sTitleS . '">
								<i class="glyphicon glyphicon-plus-sign"></i> ' . Translator::i18n('Adicionar') . '
							</a>
						</li>
					</ul>';
        }
        $lsGrid .= '
					<ul class="nav navbar-nav navbar-right">
						<li>
							<a id="modalSearchReloadBtn" data-act="' . $lsUrl . '" href="#" title="' . Translator::i18n('Reload') . '">
								<i class="glyphicon glyphicon-refresh"></i>
							</a>
						</li>
					</ul>';
        if ($this->_bSearch && (is_array($this->_aSearchFields) && count($this->_aSearchFields) > 0)) {
            $lsGrid .= '
						<div class="navbar-form navbar-right" role="search">
					    	<div class="input-group" style="margin:0; width:250px;">
								<input id="searchQuery" name="q" type="text" data-act="' . $lsUrl . '" class="form-control" placeholder="' . Translator::i18n(current($this->_aSearchFields)) . '" value="' . $lsQuery . '" />
								<span id="searchClear" class="input-group-btn"><button class="btn btn-default" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>
							</div>
						</div>';
            $lsGrid .= '
							<ul class="nav navbar-nav navbar-right">
								<li class="dropdown">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . Translator::i18n('Buscar por:') . '<b class="caret"></b></a>
									<ul class="dropdown-menu" role="menu">';
            foreach ($this->_aSearchFields as $lsField => $lsLabel) {
                $lsGrid .= '
											<li>
												<a class="searchField" href="#" data-field="' . $lsField . '" title="' . Translator::i18n($lsLabel) . '">
													' . Translator::i18n($lsLabel) . '
												</a>
											</li>';
            }
            $lsGrid .= '
									</ul>
								</li>
							</ul>';
        }
        $lsGrid .= '
				</div>
			</nav>
			</p>';
        $lsGrid .= '
			<div class="table-responsive">
				<table class="table table-hover table-condensed">
					<tr class="active">
						<th style="text-align:center;">';
        if ($psMark == 'checkbox') {
            $lsGrid .= '<a id="changeSearchRowCheck" href="#" title="' . Translator::i18n('Marcar todos') . '" data-inv="' . Translator::i18n('Desmarcar todos') . '"><i class="glyphicon glyphicon-unchecked"></i></a>';
        }
        $lsGrid .= '
						</th>';
        if (isset($this->_aSearchGridCols) && is_array($this->_aSearchGridCols)) {
            foreach ($this->_aSearchGridCols as $lmField => $lsTitle) {
                $lsGrid .= '
						<th>';
                if (is_string($lmField)) {
                    if ($laOrder['col'] == $lmField) {
                        if ($laOrder['ord'] == 'ASC') {
                            $lsGrid .= '<a class="colOrder" href="#" data-act="' . $lsUrl . '" data-col="' . $lmField . '" data-ord="DESC">' . $lsTitle . '<b class="caret"></b></a>';
                        } else {
                            $lsGrid .= '<a class="colOrder dropup" href="#" data-act="' . $lsUrl . '" data-col="' . $lmField . '" data-ord="ASC">' . $lsTitle . '<b class="caret"></b></a>';
                        }
                    } else {
                        $lsGrid .= '<a class="colOrder" href="#" data-act="' . $lsUrl . '" data-col="' . $lmField . '" data-ord="ASC">' . $lsTitle . '</a>';
                    }
                } else {
                    $lsGrid .= $lsTitle;
                }
                $lsGrid .= '
						</th>';
            }
        }
        $lsGrid .= '
					</tr>';
        if (is_array($laResults) && count($laResults) > 0) {
            foreach ($laResults as $laRes) {
                $lsReturnValue = "";
                $laLabelField = explode("|", $lsLabelField);
                if (is_array($laLabelField)) {
                    $lsPipe = "";
                    foreach ($laLabelField as $lsFieldName) {
                        if (method_exists($this, 'formatFieldToGrid')) {
                            $lsContentField = $this->formatFieldToGrid($lsFieldName, $laRes[$lsFieldName]);
                        } else {
                            $lsContentField = $laRes[$lsFieldName];
                        }
                        $lsReturnValue .= $lsPipe . $lsContentField;
                        $lsPipe = " | ";
                    }
                }
                $lsGrid .= '
					<tr class="gridRow">
						<td class="onion-grid-col-check" style="text-align:center; width:15px; background-color:#f0f0f0;">
							<input type="' . $psMark . '" name="sck[]" value="' . $laRes['id'] . '" />
							<input type="hidden" name="lb-' . $laRes['id'] . '" value="' . $lsReturnValue . '" />
						</td>';
                if (isset($this->_aSearchGridFields) && is_array($this->_aSearchGridFields)) {
                    foreach ($this->_aSearchGridFields as $lnKey => $lsField) {
                        $lsAlign = '';
                        $lsWidth = '';
                        $lsColor = '';
                        $lsContent = '';
                        if (isset($this->_aSearchGridAlign[$lnKey]) && !empty($this->_aSearchGridAlign[$lnKey])) {
                            $lsAlign = "text-align:{$this->_aSearchGridAlign[$lnKey]};";
                        }
                        if (isset($this->_aSearchGridWidth[$lnKey]) && !empty($this->_aSearchGridWidth[$lnKey])) {
                            $lsWidth = " width:{$this->_aSearchGridWidth[$lnKey]};";
                        }
                        if (isset($this->_aSearchGridColor[$lnKey]) && !empty($this->_aSearchGridColor[$lnKey])) {
                            $lsColor = " background:{$this->_aSearchGridColor[$lnKey]};";
                        }
                        if (isset($laRes[$lsField])) {
                            if (method_exists($this, 'formatFieldToGrid')) {
                                $lsContent = $this->formatFieldToGrid($lsField, $laRes[$lsField]);
                            } else {
                                $lsContent = $laRes[$lsField];
                            }
                        }
                        $lsStyle = $lsAlign . $lsWidth . $lsColor;
                        if (!empty($lsStyle)) {
                            $lsStyle = 'style="' . $lsStyle . '"';
                        }
                        $lsGrid .= '<td class="onion-grid-col-' . $this->_sModule . '-' . $lsField . '" ' . $lsStyle . '>' . $lsContent . '</td>';
                    }
                }
                $lsGrid .= '
					</tr>';
            }
        } else {
            $lnCols = count($this->_aSearchGridFields) + 2;
            $lsGrid .= '
					<tr>
						<td colspan="' . $lnCols . '" style="text-align:center;">
							<p>
								<strong>' . Translator::i18n('Nenhum registro encontrado!') . '</strong>
							</p>
						</td>
					</tr>';
        }
        $lsGrid .= '
				</table>
			</div>';
        $lsGrid .= '
			<nav class="navbar navbar-default">
				<div class="container">
					<div class="row">
						<div class="col-md-2">
							<div style="margin-top:26px;">
								&nbsp;&nbsp;&nbsp;' . $lnCurrent . ' - ' . $laData['until'] . ' (' . $laData['total'] . ')
							</div>
						</div>
						<div class="col-md-10">
							' . $loPagination->renderPagination() . '
						</div>
					</div>
				</div>
			</nav>';
        $lsGrid .= '
		</div>';
        $lsGrid .= '<script type="text/javascript" src="/vendor/m3uzz/onionjs-0.16.4/dist/js/search.js"></script>';
        $lsGrid .= '<script type="text/javascript" src="/vendor/m3uzz/onionjs-0.16.4/dist/js/common.js"></script>';
        $lsGrid .= '<script type="text/javascript" src="/js/backend.js"></script>';
        return $lsGrid;
    }
Example #26
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'stCountry', 'attributes' => array('id' => 'stCountry', 'type' => 'text', 'placeholder' => Translator::i18n('Country name'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Country')), 'options' => array('label' => Translator::i18n('Country') . ': ', 'for' => 'stCountry')));
     $this->add(array('name' => 'stAbreviationISO3', 'attributes' => array('id' => 'stAbreviationISO3', 'type' => 'text', 'placeholder' => Translator::i18n('ISO 3 eg.: BRA, USA'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Abreviation ISO 3'), 'maxlength' => 3), 'options' => array('label' => Translator::i18n('Abreviation ISO 3') . ': ', 'for' => 'stAbreviationISO3')));
     $this->add(array('name' => 'stAbreviationISO2', 'attributes' => array('id' => 'stAbreviationISO2', 'type' => 'text', 'placeholder' => Translator::i18n('ISO 2 eg.: BR, US'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('Abreviation ISO 2'), 'maxlength' => 2), 'options' => array('label' => Translator::i18n('Abreviation ISO 2') . ': ', 'for' => 'stAbreviationISO2')));
     $this->add(array('name' => 'stTLD', 'attributes' => array('id' => 'stTLD', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: .br, .com'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('TLD'), 'maxlength' => 4), 'options' => array('label' => Translator::i18n('TLD') . ': ', 'for' => 'stTLD')));
     $this->add(array('name' => 'stLocale', 'attributes' => array('id' => 'stLocale', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: pt_BR, en_US'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Locale'), 'maxlength' => 5), 'options' => array('label' => Translator::i18n('Locale') . ': ', 'for' => 'stLocale')));
     $this->add(array('name' => 'stCurrency', 'attributes' => array('id' => 'stCurrency', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: R$, $'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Currency'), 'maxlength' => 3), 'options' => array('label' => Translator::i18n('Currency') . ': ', 'for' => 'stCurrency')));
     $this->add(array('name' => 'stCurrencyLabel', 'attributes' => array('id' => 'stCurrencyLabel', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: Real, Dollar'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Country Label')), 'options' => array('label' => Translator::i18n('Currency Label') . ': ', 'for' => 'stCurrencyLabel')));
     $this->add(array('name' => 'stCurrencyAbreviation', 'attributes' => array('id' => 'stCurrencyAbreviation', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: BRL, USD'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Currency Abreviation'), 'maxlength' => 3), 'options' => array('label' => Translator::i18n('Currency Abreviation') . ': ', 'for' => 'stCurrencyAbreviation')));
     $this->add(array('name' => 'stCallingCode', 'attributes' => array('id' => 'stCallingCode', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: +55, +1'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Calling Code'), 'maxlength' => 4), 'options' => array('label' => Translator::i18n('Calling Code') . ': ', 'for' => 'stCallingCode')));
     $this->add(array('name' => 'stDateFormate', 'attributes' => array('id' => 'stDateFormate', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: dd/mm/YYYY, YYYY-mm-dd'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Date Formate'), 'maxlength' => 10), 'options' => array('label' => Translator::i18n('Date Formate') . ': ', 'for' => 'stDateFormate')));
     $this->add(array('name' => 'stTimeZone', 'attributes' => array('id' => 'stTimeZone', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: GMT-3, GMT-4'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Time Zone'), 'maxlength' => 6), 'options' => array('label' => Translator::i18n('Time Zone') . ': ', 'for' => 'stTimeZone')));
     $this->add(array('name' => 'stSummerTimeZone', 'attributes' => array('id' => 'stSummerTimeZone', 'type' => 'text', 'placeholder' => Translator::i18n('eg.: GMT-2, GMT-3'), 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Summer Time Zone'), 'maxlength' => 6), 'options' => array('label' => Translator::i18n('Summer Time Zone') . ': ', 'for' => 'stSummerTimeZone')));
     $this->add(array('name' => 'City_id', 'attributes' => array('id' => 'City_id', 'type' => 'hidden', 'required' => true)));
     $this->add(array('name' => 'CityName', 'attributes' => array('id' => 'CityName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Capital City'), 'required' => true), 'options' => array('label' => Translator::i18n('Capital City') . ': ', 'for' => 'CityName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Select Capital City'), 'data-btn' => Translator::i18n('Select'), 'data-act' => '/city/search-select', 'data-return' => 'City_id'))));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Save'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     // Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #27
0
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden')));
     $this->add(array('name' => 'Estate_id', 'attributes' => array('id' => 'Estate_id', 'type' => 'hidden', 'required' => true)));
     $this->add(array('name' => 'EstateName', 'attributes' => array('id' => 'EstateName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Estate'), 'required' => true), 'options' => array('label' => Translator::i18n('Estate') . ': ', 'for' => 'EstateName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Select Estate'), 'data-btn' => Translator::i18n('Select'), 'data-act' => '/estate/search-select', 'data-return' => 'Estate_id'))));
     $this->add(array('name' => 'stCity', 'attributes' => array('id' => 'stCity', 'type' => 'text', 'placeholder' => Translator::i18n('City name'), 'class' => 'form-control', 'required' => true, 'title' => Translator::i18n('City')), 'options' => array('label' => Translator::i18n('City') . ': ', 'for' => 'stCity')));
     $this->add(array('name' => 'stAbreviation', 'attributes' => array('id' => 'stAbreviation', 'type' => 'text', 'placeholder' => Translator::i18n('Abreviation'), 'class' => 'form-control', 'title' => Translator::i18n('Abreviation'), 'maxlength' => 3), 'options' => array('label' => Translator::i18n('Abreviation') . ': ', 'for' => 'stAbreviation')));
     $this->add(array('name' => 'stZipCode', 'attributes' => array('id' => 'stZipCode', 'type' => 'text', 'placeholder' => Translator::i18n('Zip Code'), 'class' => 'form-control', 'title' => Translator::i18n('Zip Code'), 'maxlength' => 15), 'options' => array('label' => Translator::i18n('Zip Code') . ': ', 'for' => 'stZipCode')));
     $this->add(array('name' => 'stLatitude', 'attributes' => array('id' => 'stLatitude', 'type' => 'text', 'placeholder' => Translator::i18n('Latitude Coordenate'), 'class' => 'form-control', 'title' => Translator::i18n('Latitude'), 'maxlength' => 20), 'options' => array('label' => Translator::i18n('Latitude') . ': ', 'for' => 'stLatitude')));
     $this->add(array('name' => 'stLongitude', 'attributes' => array('id' => 'stLongitude', 'type' => 'text', 'placeholder' => Translator::i18n('Longitude Coordenate'), 'class' => 'form-control', 'title' => Translator::i18n('Longitude'), 'maxlength' => 20), 'options' => array('label' => Translator::i18n('Longitude') . ': ', 'for' => 'stLongitude')));
     $this->add(array('name' => 'stGeoLocalization', 'attributes' => array('id' => 'stGeoLocalization', 'type' => 'text', 'placeholder' => Translator::i18n('Google Maps X,Y Coordenate'), 'class' => 'form-control', 'title' => Translator::i18n('Geo Localization'), 'maxlength' => 60), 'options' => array('label' => Translator::i18n('Geo Localization') . ': ', 'for' => 'stGeoLocalization')));
     $this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Save'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     //Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #28
0
 /**
  *
  * @return \Onion\Mvc\Controller\unknown
  */
 public function facebookAction()
 {
     $gaConfig = Config::getAppOptions('service');
     $lsAccessToken = $this->request('at', null);
     $lsUrlFrom = $this->request('urlFrom', '/');
     if (isset($gaConfig['facebook']) && null !== $lsAccessToken) {
         FacebookSession::setDefaultApplication($gaConfig['facebook'][APP_ENV]['app-id'], $gaConfig['facebook'][APP_ENV]['secret']);
         $loHelper = new FacebookRedirectLoginHelper('');
         try {
             $loSession = new FacebookSession($lsAccessToken);
         } catch (FacebookRequestException $e) {
             // When Facebook returns an error
             $this->flashMessenger()->addMessage(array('id' => $this->get('_sModule') . '-' . microtime(true), 'hidden' => $this->get('_bHiddenPushMessage'), 'push' => $this->get('_bPushMessage'), 'type' => 'warning', 'msg' => Translator::i18n($e->getMessage())));
         } catch (\Exception $e) {
             // When validation fails or other local issues
             $this->flashMessenger()->addMessage(array('id' => $this->get('_sModule') . '-' . microtime(true), 'hidden' => $this->get('_bHiddenPushMessage'), 'push' => $this->get('_bPushMessage'), 'type' => 'warning', 'msg' => Translator::i18n($e->getMessage())));
         }
         $loRequest = new FacebookRequest($loSession, 'GET', '/me');
         $loResponse = $loRequest->execute();
         $loGraphObject = $loResponse->getGraphObject();
         $lsUserVerified = $loGraphObject->getProperty('verified');
         if ($lsUserVerified == '1') {
             $lsUsername = $loGraphObject->getProperty('email');
             $loIdentity = $this->getEntityManager()->getRepository('User\\Entity\\UserBasic')->findOneBy(array('stUsername' => $lsUsername));
             if ($loIdentity !== null) {
                 $loAuthService = $this->getServiceLocator()->get('Zend\\Authentication\\AuthenticationService');
                 $lsStatus = $this->authentication($loAuthService, $loIdentity, $lsUrlFrom, null, 'facebook');
             } else {
                 try {
                     return $this->redirect()->toUrl("/profile/facebook/?at={$lsAccessToken}&urlFrom={$lsUrlFrom}");
                 } catch (\Exception $e) {
                     $this->flashMessenger()->addMessage(array('id' => $this->get('_sModule') . '-' . microtime(true), 'hidden' => $this->get('_bHiddenPushMessage'), 'push' => $this->get('_bPushMessage'), 'type' => 'warning', 'msg' => Translator::i18n($e->getMessage())));
                 }
             }
         }
     }
     $loView = new ViewModel();
     return $this->setResponseType($loView);
 }
Example #29
0
 /**
  *
  */
 public function setForm()
 {
     $this->setAttribute('method', 'post');
     $this->setAttribute('role', 'form');
     $lbRequired = true;
     $lbReadOnly = false;
     if ($this->_sActionType == 'edit') {
         $lbRequired = false;
         $lbReadOnly = true;
     }
     $this->add(array('name' => 'User_id', 'attributes' => array('id' => 'User_id', 'type' => 'hidden', 'required' => false)));
     $this->add(array('name' => 'UserName', 'attributes' => array('id' => 'UserName', 'type' => 'text', 'class' => 'form-control', 'title' => Translator::i18n('Usuário'), 'required' => false), 'options' => array('label' => Translator::i18n('Usuário') . ': ', 'for' => 'UserName', 'data-type' => 'openModalBtn', 'openModalBtn' => array('data-title' => Translator::i18n('Usuário'), 'data-btn' => Translator::i18n('Selecinar'), 'data-act' => '/user/search-select', 'data-return' => 'User_id'))));
     $this->add(array('name' => 'stIP', 'attributes' => array('id' => 'stIP', 'type' => 'text', 'placeholder' => '   .   .   .', 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('IP de acesso'), 'data-mask' => '999.999.999.999'), 'options' => array('label' => Translator::i18n('Ip de acesso') . ': ', 'for' => 'stIP')));
     $this->add(array('name' => 'dtPeriodInit', 'attributes' => array('id' => 'dtPeriodInit', 'type' => 'text', 'placeholder' => 'YYYY-MM-DD', 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Período de'), 'data-mask' => '0000-00-00'), 'options' => array('label' => Translator::i18n('Período de') . ': ', 'for' => 'dtPeriodInit', 'data-type' => 'datePicker')));
     $this->add(array('name' => 'dtPeriodEnd', 'attributes' => array('id' => 'dtPeriodEnd', 'type' => 'text', 'placeholder' => 'YYYY-MM-DD', 'class' => 'form-control', 'required' => false, 'title' => Translator::i18n('Período até'), 'data-mask' => '0000-00-00'), 'options' => array('label' => Translator::i18n('Período até') . ': ', 'for' => 'dtPeriodEnd', 'data-type' => 'datePicker')));
     //$this->add(new Csrf('security'));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Filtrar'), 'id' => 'submitbutton', 'class' => 'btn btn-primary')));
     // Load and set the client specific configuration for this form
     $this->clientSets();
 }
Example #30
0
    /**
     * 
     * @return string
     */
    public function renderSeachModal()
    {
        $lsForm = '
			<div id="ajaxFormModal" class="modal fade bs-example-modal-lg hidden-print" tabindex="-1" role="dialog" aria-labelledby="ajaxFormModalLabel" aria-hidden="true">
				<div class="modal-dialog modal-lg">
			    	<div class="modal-content">
			      		<div class="modal-header">
			        		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			        		<h4 class="modal-title" id="ajaxFormModalLabel"></h4>
			      		</div>
			      		<div class="modal-body">
			      		</div>
			      		<div class="modal-footer">
			        		<button id="ajaxFormModalCancelBtn" type="button" class="btn btn-default" data-dismiss="modal">' . Translator::i18n('Cancelar') . '</button>
			        		<button id="ajaxFormModalConfirmBtn" type="button" class="btn btn-primary" data-dismiss="modal">' . Translator::i18n('Confirmar') . '</button>
			        	</div>
			    	</div>
			  	</div>
			</div>';
        return $lsForm;
    }