From 041944705b0bb9287b2dce239730551a98c15a35 Mon Sep 17 00:00:00 2001 From: bjverde Date: Mon, 13 Sep 2021 00:57:24 -0300 Subject: [PATCH] :memo: BASE update version 5.0.0-alpha25 --- .../FormDin5/helpers/DateTimeHelper.class.php | 37 ++++++++++ .../FormDin5/helpers/FormDinHelper.class.php | 2 +- .../FormDinFields/TFormDinCheckList.class.php | 10 +-- .../TFormDinEmailField.class.php | 14 ++-- .../TFormDinSelectField.class.php | 28 ++++---- .../FormDin5/webform/TFormDin.class.php | 69 ++++++++++--------- .../FormDin5/webform/TFormDinGrid.class.php | 44 ++++++------ .../webform/TFormDinPdoConnection.class.php | 5 +- 8 files changed, 125 insertions(+), 84 deletions(-) diff --git a/FormDin5/lib/widget/FormDin5/helpers/DateTimeHelper.class.php b/FormDin5/lib/widget/FormDin5/helpers/DateTimeHelper.class.php index 9ada9a64..a3fe7b04 100644 --- a/FormDin5/lib/widget/FormDin5/helpers/DateTimeHelper.class.php +++ b/FormDin5/lib/widget/FormDin5/helpers/DateTimeHelper.class.php @@ -98,6 +98,43 @@ public static function getNowYYYYMMDD() return $retorno; } + public static function getListMesesExtenso($strarWithZero=true) + { + $listMeses = null; + if($strarWithZero==true){ + $listMeses = array( + '01' => 'Janeiro' + ,'02' => 'Fevereiro' + ,'03' => 'Março' + ,'04' => 'Abril' + ,'05' => 'Maio' + ,'06' => 'Junho' + ,'07' => 'Julho' + ,'08' => 'Agosto' + ,'09' => 'Setembro' + ,'10' => 'Outubro' + ,'11' => 'Novembro' + ,'12' => 'Dezembro' + ); + }else{ + $listMeses = array( + '1' => 'Janeiro' + ,'2' => 'Fevereiro' + ,'3' => 'Março' + ,'4' => 'Abril' + ,'5' => 'Maio' + ,'6' => 'Junho' + ,'7' => 'Julho' + ,'8' => 'Agosto' + ,'9' => 'Setembro' + ,'10' => 'Outubro' + ,'11' => 'Novembro' + ,'12' => 'Dezembro' + ); + } + return $listMeses; + } + public static function mesExtenso($numeroMes) { $numeroMes = intval($numeroMes); diff --git a/FormDin5/lib/widget/FormDin5/helpers/FormDinHelper.class.php b/FormDin5/lib/widget/FormDin5/helpers/FormDinHelper.class.php index ecb8c007..f7b6d19b 100644 --- a/FormDin5/lib/widget/FormDin5/helpers/FormDinHelper.class.php +++ b/FormDin5/lib/widget/FormDin5/helpers/FormDinHelper.class.php @@ -62,7 +62,7 @@ class FormDinHelper { - const FORMDIN_VERSION = '5.0.0-alpha24'; + const FORMDIN_VERSION = '5.0.0-alpha25'; const GRID_SIMPLE = 'GRID_SIMPLE'; const GRID_SCREEN_PAGINATION = 'GRID_SCREEN_PAGINATION'; const GRID_SQL_PAGINATION = 'GRID_SQL_PAGINATION'; diff --git a/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinCheckList.class.php b/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinCheckList.class.php index cfb8ea72..957d707b 100644 --- a/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinCheckList.class.php +++ b/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinCheckList.class.php @@ -89,11 +89,11 @@ class TFormDinCheckList { * @param boolean $makeScrollable - 7 : DEFAULT = false * @return TFormDinCheckList */ - public function __construct($id - , $label - , $boolRequired=false - , $listItems - , $intHeight=null + public function __construct(string $id + ,string $label + ,mixed $boolRequired=false + ,mixed $listItems + ,int $intHeight=null ) { diff --git a/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinEmailField.class.php b/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinEmailField.class.php index 0a195b46..d6311d76 100644 --- a/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinEmailField.class.php +++ b/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinEmailField.class.php @@ -66,16 +66,16 @@ class TFormDinEmailField extends TFormDinTextField * * @return TFormDinEmailField Field */ - public function __construct( $id - , $label=null - , $intMaxLength - , $boolRequired=null - , $intSize=null + public function __construct( string $id + , string $label=null + , int $intMaxLength + , mixed $boolRequired=null + , int $intSize=null , $boolNewLine=null - , $strValue=null + , string $strValue=null , $boolLabelAbove=null , $boolNoWrapLabel=null - , $placeholder=null + , string $placeholder=null ) { parent::__construct($id diff --git a/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinSelectField.class.php b/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinSelectField.class.php index 456c8a41..0b512624 100644 --- a/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinSelectField.class.php +++ b/FormDin5/lib/widget/FormDin5/webform/FormDinFields/TFormDinSelectField.class.php @@ -110,20 +110,20 @@ class TFormDinSelectField extends TFormDinOption */ public function __construct(string $id ,string $label - ,$boolRequired = false - ,$mixOptions - ,$boolNewLine = true - ,$boolLabelAbove = false - ,$mixValue = null - ,$boolMultiSelect = false - ,$intQtdColumns = null - ,$intWidth = null - ,$strFirstOptionText = null - ,$strFirstOptionValue = null - ,$strKeyColumn = null - ,$strDisplayColumn = null - ,$boolNoWrapLabel = null - ,$strDataColumns = null + ,mixed $boolRequired = false + ,mixed $mixOptions + ,mixed $boolNewLine = true + ,mixed $boolLabelAbove = false + ,mixed $mixValue = null + ,mixed $boolMultiSelect = false + ,int $intQtdColumns = null + ,int $intWidth = null + ,string $strFirstOptionText = null + ,string $strFirstOptionValue = null + ,string $strKeyColumn = null + ,string $strDisplayColumn = null + ,mixed $boolNoWrapLabel = null + ,string $strDataColumns = null ) { $this->setWidth( $intWidth ); diff --git a/FormDin5/lib/widget/FormDin5/webform/TFormDin.class.php b/FormDin5/lib/widget/FormDin5/webform/TFormDin.class.php index b9a4f6e8..f8509693 100644 --- a/FormDin5/lib/widget/FormDin5/webform/TFormDin.class.php +++ b/FormDin5/lib/widget/FormDin5/webform/TFormDin.class.php @@ -488,20 +488,21 @@ public function addMessage( $message * @param string $strHorizontalAlign-14 : NOT_IMPLEMENTED Text Horizontal align. DEFAULT = center. Values center, left, right * @return TButton|string|array */ - public function addButton( $mixValue - , $strNameId=null - , $strAction - , $strOnClick=null - , $strConfirmMessage=null - , $boolNewLine=null - , $boolFooter=true - , $strImage=null - , $strImageDisabled=null - , $strHint=null - , $strVerticalAlign=null - , $boolLabelAbove=null - , $strLabel=null - , $strHorizontalAlign=null) + public function addButton( string $mixValue + , string $strNameId=null + , string $strAction + , string $strOnClick=null + , string $strConfirmMessage=null + , mixed $boolNewLine=null + , mixed $boolFooter=true + , string $strImage=null + , string $strImageDisabled=null + , string $strHint=null + , string $strVerticalAlign=null + , mixed $boolLabelAbove=null + , string $strLabel=null + , string $strHorizontalAlign=null + ) { $objForm = $this->getObjForm(); if($boolFooter){ @@ -1223,20 +1224,20 @@ public function addTimeField( $strName */ public function addSelectField(string $id ,string $strLabel - ,$boolRequired = false - ,array $mixOptions - ,$boolNewLine = true - ,$boolLabelAbove = false - ,$mixValue = null - ,$boolMultiSelect = false - ,$intSize = null - ,$intWidth = null - ,$strFirstOptionText = null - ,$strFirstOptionValue = null - ,$strKeyColumn = null - ,$strDisplayColumn = null - ,$boolNoWrapLabel = null - ,$strDataColumns = null + ,mixed $boolRequired = false + ,mixed $mixOptions + ,mixed $boolNewLine = true + ,mixed $boolLabelAbove = false + ,mixed $mixValue = null + ,mixed $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 ) { $formField = new TFormDinSelectField($id @@ -1658,9 +1659,9 @@ public function addCheckList( $objCheckList,$boolNewLine = true) * @param string $decimalsSeparator -19: FORMDIN5: separador decimal. Não pode ser chamado por metodo * @return TNumber */ - public function addNumberField( $strName - , $strLabel=null - , $intMaxLength + public function addNumberField( string $strName + , string $strLabel=null + , int $intMaxLength , $boolRequired=null , $intDecimalPlaces=null , $boolNewLine=null @@ -1723,9 +1724,9 @@ public function addNumberField( $strName * @param string $placeholder -09: FORMDIN5: Texto do Place Holder * @return TFormDinEmailField */ - public function addEmailField( $strName - , $strLabel=null - , $intMaxLength + public function addEmailField( string $strName + , string $strLabel=null + , int $intMaxLength , $boolRequired=null , $intSize=null , $boolNewLine=null diff --git a/FormDin5/lib/widget/FormDin5/webform/TFormDinGrid.class.php b/FormDin5/lib/widget/FormDin5/webform/TFormDinGrid.class.php index e7a45202..eb8ee752 100644 --- a/FormDin5/lib/widget/FormDin5/webform/TFormDinGrid.class.php +++ b/FormDin5/lib/widget/FormDin5/webform/TFormDinGrid.class.php @@ -239,11 +239,11 @@ public function setId($idGrid){ * @param string $align - 5: * @return void */ - public function addElementColumnList($type = self::TYPE_SIMPLE - , string $idcolumn - , string $label - , string $width = NULL - , string $align = 'left' + public function addElementColumnList(string $type = self::TYPE_SIMPLE + ,string $idcolumn + ,string $label + ,string $width = NULL + ,string $align = 'left' ) { $element = array(); @@ -535,12 +535,12 @@ public function addColumnFormatDate(string $name * @param boolean $boolAllowCheckAll - TRUE = pode selecionar todos , FALSE = não permite multiplas seleções * @return TGridCheckColumn */ - public function addCheckColumn( $strName - , $strTitle = null - , $strKeyField - , $strDescField = null - , $boolReadOnly = null - , $boolAllowCheckAll = null ) + public function addCheckColumn( string $strName + , string $strTitle = null + , string $strKeyField + , string $strDescField = null + , mixed $boolReadOnly = null + , mixed $boolAllowCheckAll = null ) { if ( !$strKeyField ){ $strKeyField = strtoupper( $strName ); @@ -586,17 +586,17 @@ public function getMixUpdateButton($mixUpdateButton){ * @param string $classDestiny -11: FORMDIN5: nome da classe que vai tratar ação. o Valor Defualt é propria classe * @return object TFormDinGridAction */ - public function addButton( $strRotulo - , $strAction = null - , $strName = null - , $strOnClick = null - , $strConfirmMessage = null - , $strImage = null - , $strImageDisabled = null - , $strHint = null - , $boolSubmitAction = null - , $mixUpdateButton = null - , $classDestiny = null + public function addButton( string $strRotulo + , string $strAction = null + , string $strName = null + , string $strOnClick = null + , string $strConfirmMessage = null + , string $strImage = null + , string $strImageDisabled = null + , string $strHint = null + , mixed $boolSubmitAction = null + , mixed $mixUpdateButton = null + , $classDestiny = null ){ $mixUpdateButton = $this->getMixUpdateButton($mixUpdateButton); if( empty($mixUpdateButton) ){ diff --git a/FormDin5/lib/widget/FormDin5/webform/TFormDinPdoConnection.class.php b/FormDin5/lib/widget/FormDin5/webform/TFormDinPdoConnection.class.php index 00b1e7d3..c7d44204 100644 --- a/FormDin5/lib/widget/FormDin5/webform/TFormDinPdoConnection.class.php +++ b/FormDin5/lib/widget/FormDin5/webform/TFormDinPdoConnection.class.php @@ -72,7 +72,7 @@ class TFormDinPdoConnection /** * Facilitardor de conexão com o banco de dados * - * @param string $database : nome da conexão. É o nome do arquivo INI de configuração do banco + * @param string $database : nome da conexão. É o nome do arquivo INI ou PHP de configuração do banco. Informe NULL para setar cada propriedade manualmente * @param const $outputMode: DEFAULT = ArrayHelper::TYPE_PDO. ArrayHelper::TYPE_FORMDIN, ArrayHelper::TYPE_ADIANTI * @param const $fech: DEFAULT = PDO::FETCH_OBJ array de Objet, PDO::FETCH_ASSOC - array simples * @param const $case use PDO case. DEFAULT = CASE_NATURAL. https://www.php.net/manual/pt_BR/pdo.prepare.php @@ -81,6 +81,9 @@ public function __construct($database = null,$outputFormat = null,$fech = null,$ { if(!empty($database)){ $this->setDatabase($database); + $arrParams = TConnection::getDatabaseInfo($database); + $type = ArrayHelper::get($arrParams,'type'); + $this->setDdms($type); } $this->setOutputFormat($outputFormat); $this->setFech($fech);