Skip to content

Commit

Permalink
🔨 #239 #238 #236
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Jul 14, 2022
1 parent 8c99516 commit 4b44f30
Showing 1 changed file with 134 additions and 34 deletions.
168 changes: 134 additions & 34 deletions FormDin5/lib/widget/FormDin5/webform/TFormDin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -980,30 +980,42 @@ public function addSwitchField(string $id
* saber o que cada marca singinifica.
* ------------------------------------------------------------------------
*
* @param string $strName - 1: id do campo
* @param string $strLabel - 2: Rotulo do campo que irá aparece na tela
* @param boolean $boolRequired - 3: Campo obrigatório ou não. Default FALSE = não obrigatório, TRUE = obrigatório
* @param boolean $boolNewLine - 4: Em nova linha, DEFALUT is TRUE não obrigatorio.
* @param integer $intmaxLength - 5: Tamanho maximo
* @param string $strValue - 6: Valor inicial
* @param boolean $boolLabelAbove - 7: Label acima, DEFAULT is FALSE na mesma linha
* @param boolean $enableToggleVisibility- 8: NOT_IMPLEMENTED true ou false para quebrar ou não o valor do label se não couber na coluna do formulario
* @param string $id -01: id do campo
* @param string $label -02: Rotulo do campo que irá aparece na tela
* @param boolean $boolRequired -03: Campo obrigatório ou não. Default FALSE = não obrigatório, TRUE = obrigatório
* @param boolean $boolNewLine -04: Em nova linha, DEFALUT is TRUE não obrigatorio.
* @param integer $intmaxLength -05: Tamanho maximo
* @param string $value -06: Valor inicial
* @param boolean $boolLabelAbove -07: Label acima, DEFAULT is FALSE na mesma linha
* @param boolean $boolNoWrapLabel -08: NOT_IMPLEMENTED
* @param integer $intSize -09: NOT_IMPLEMENTED
* @param boolean $boolUseVirtualKeyboard-10: NOT_IMPLEMENTED
* @param boolean $boolShowVirtualKeyboardImage -11: NOT_IMPLEMENTED
* @param boolean $boolReadOnly -12: NOT_IMPLEMENTED
* @param boolean $enableToggleVisibility-13: FORMDIN5 DEFALUT is TRUE mostra a senha ou não
* @return TFormDinPassword
*/
public function addPasswordField( string $strName
, string $strLabel=null
public function addPasswordField( string $id
, string $label=null
, $boolRequired=null
, $boolNewLine=null
, $intmaxLength=null
, $strValue=null
, $value=null
, $boolLabelAbove=null
, $boolNoWrapLabel=null
, $intSize=null
, $boolUseVirtualKeyboard=null
, $boolShowVirtualKeyboardImage=null
, $boolReadOnly=null )
, $boolReadOnly=null
, $enableToggleVisibility=true)
{
$formField = new TFormDinSwitch($id,$strLabel,$boolRequired,$itens);
$formField = new TFormDinPassword($id
,$label
,$boolRequired
,$intmaxLength
,$value
,$enableToggleVisibility
);
$objField = $formField->getAdiantiObj();
$label = $formField->getLabel();
$this->addElementFormList($objField,self::TYPE_FIELD,$label,$boolNewLine,$boolLabelAbove);
Expand Down Expand Up @@ -1032,16 +1044,19 @@ public function addPasswordField( string $strName
* @param boolean $loop - 8: Default FALSE = habilita o video em loop, FALSE não fica em loop
* @return TFormDinVideoHtml
*/
public function addVidoHtml5(string $id
public function addVideoHtml5(string $id
,string $label
,bool $boolNewLine
,bool $boolLabelAbove
,$boolNewLine
,$boolLabelAbove
,string $strValue
,bool $controls
,bool $autoplay
,bool $loop
,$controls = true
,$autoplay = false
,$loop = false
)
{
$boolNewLine = empty($boolNewLine)?true:$boolNewLine;
$boolLabelAbove = empty($boolLabelAbove)?false:$boolLabelAbove;

$formField = new TFormDinVideoHtml($id,$label,$strValue,$controls,$autoplay,$loop);
$objField = $formField->getAdiantiObj();
$label = $formField->getLabel();
Expand Down Expand Up @@ -1096,7 +1111,7 @@ public function addFileField(string $id
, $boolLabelAbove=true
, $boolNoWrapLabel=null
, $strMessageInvalidFileType=null
, $value
, $value=null
, $enableFileHandling=false
, $enablePopover=false
, $enableImageGallery=null
Expand Down Expand Up @@ -1216,6 +1231,91 @@ public function addTimeField( $strName
return $formField;
}

/**
* Adicionar campo tipo combobox ou menu select
* ------------------------------------------------------------------------
* Esse é o FormDin 5, que é uma reconstrução do FormDin 4 Sobre o Adianti 7.X
* os parâmetros do metodos foram marcados veja documentação da classe para
* saber o que cada marca singinifica.
* ------------------------------------------------------------------------
*
* $mixOptions = array no formato "key=>value". No FormDin 5 só permite array PHP
* $strKeyColumn = nome da coluna que será utilizada para preencher os valores das opções
* $strDisplayColumn = nome da coluna que será utilizada para preencher as opções que serão exibidas para o usuário
* $strDataColumns = informações extras do banco de dados que deverão ser adicionadas na tag option do campo select
*
* <code>
* // exemplos
* $frm->addSelectField('tipo','Tipo:',false,'1=Tipo 1,2=Tipo 2');
* $frm->addSelectField('tipo','Tipo:',false,'tipo');
* $frm->addSelectField('tipo','Tipo:',false,'select * from tipo order by descricao');
* $frm->addSelectField('tipo','Tipo:',false,'tipo|descricao like "F%"');
*
* //Exemplo espcial - Campo obrigatorio e sem senhum elemento pre selecionado.
* $frm->addSelectField('tipo','Tipo',true,$tiposDocumentos,null,null,null,null,null,null,' ','');
* </code>
*
* @param string $strName - 1: ID do campo
* @param string $strLabel - 2: Label do campo
* @param boolean $boolRequired - 3: Campo obrigatório ou não. Default FALSE = não obrigatório, TRUE = obrigatório
* @param mixed $mixOptions - 4: String "S=SIM,N=NAO,..." ou Array dos valores nos formatos: ArrayHelper::TYPE_ADIANTI, ArrayHelper::TYPE_PDO, ArrayHelper::TYPE_FORMDIN e ArrayHelper::TYPE_PHP
* @param boolean $boolNewLine - 5: Default TRUE = cria nova linha, FALSE = fica depois do campo anterior
* @param boolean $boolLabelAbove - 6: Label sobre o campo. Default FALSE = Label mesma linha, TRUE = Label acima
* @param mixed $mixValue - 7: Valor DEFAULT, informe o ID do array
* @param boolean $boolMultiSelect- 8: Default FALSE = SingleSelect, TRUE = MultiSelect
* @param integer $intSize - 09: NOT_IMPLEMENTED Default 1. Num itens que irão aparecer.
* @param integer $intWidth - 10: DEPRECATED. Informe NULL para evitar o warning. Largura em Pixels
* @param string $strFirstOptionText - 11: NOT_IMPLEMENTED First Key in Display
* @param string $strFirstOptionValue- 12: Frist Value in Display, use value NULL for required. Para o valor DEFAULT informe o ID do $mixOptions e $strFirstOptionText = '' e não pode ser null
* @param string $strKeyColumn - 13: Nome da coluna que será utilizada para preencher os valores das opções
* @param string $strDisplayColumn - 14: Nome da coluna que será utilizada para preencher as opções que serão exibidas para o usuário
* @param string $boolNoWrapLabel - 15: NOT_IMPLEMENTED true ou false para quebrar ou não o valor do label se não couber na coluna do formulario
* @param string $strDataColumns - 16: NOT_IMPLEMENTED Informações extras do banco de dados que deverão ser adicionadas na tag option do campo select
* @return TCombo
*/
public function addSelectField(string $id
,string $strLabel
,$boolRequired
,$mixOptions
,$boolNewLine = true
,$boolLabelAbove = false
,$mixValue = null
,$boolMultiSelect = false
,int $intSize = null
,int $intWidth = null
,string $strFirstOptionText = null
,string $strFirstOptionValue = null
,string $strKeyColumn = null
,string $strDisplayColumn = null
,string $boolNoWrapLabel = null
,string $strDataColumns = null
)
{
$boolRequired = empty($boolRequired)?false:$boolRequired;
$formField = new TFormDinSelectField($id
,$strLabel
,$boolRequired
,$mixOptions
,$boolNewLine
,$boolLabelAbove
,$mixValue
,$boolMultiSelect
,$intSize
,$intWidth
,$strFirstOptionText
,$strFirstOptionValue
,$strKeyColumn
,$strDisplayColumn
,$boolNoWrapLabel
,$strDataColumns
);
$objField = $formField->getAdiantiObj();
$label = $formField->getLabel();
$this->addElementFormList($objField,self::TYPE_FIELD,$label,$boolNewLine,$boolLabelAbove);
return $formField;
}


/**
* Adicionar campo tipo combobox ou menu select que faz uma busca no banco
* usando TRecord
Expand All @@ -1242,20 +1342,20 @@ public function addTimeField( $strName
* @param string $placeholder - 12: PlaceHolder é um Texto de exemplo
* @return TDBCombo
*/
public function addSelectField(string $id
,string $label
,bool $boolRequired
,bool $boolNewLine
,bool $boolLabelAbove
,string $value
,string $database
,string $model
,string $key
,string $name
,string $ordercolumn = null
,TCriteria $criteria = null
,bool $enableSearch = true
,bool $placeholder = null
public function addSelectFieldDB(string $id
,string $label
,$boolRequired
,$boolNewLine
,$boolLabelAbove
,string|null $value
,string $database
,string $model
,string $key
,string $name
,string|null $ordercolumn = null
,TCriteria|null $criteria = null
,$enableSearch = true
,$placeholder = null
)
{
$boolRequired = empty($boolRequired)?false:$boolRequired;
Expand Down

0 comments on commit 4b44f30

Please sign in to comment.