Skip to content

Commit

Permalink
🔨 #112 setheight
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Jul 19, 2020
1 parent f4a4013 commit 2d1e53e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 80 deletions.
110 changes: 36 additions & 74 deletions appexemplo_v1.0/app/lib/widget/FormDin5/webform/TFormDinGrid.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class TFormDinGrid
* @param string $strName - 2: ID da grid
* @param string $strTitle - 3: Titulo da grip
* @param array $mixData - 4: Array de dados. Pode ser form formato Adianti, FormDin ou PDO
* @param mixed $strHeight - 5: DEPRECATED Altura
* @param mixed $strWidth - 6: DEPRECATED Largura
* @param mixed $strHeight - 5: Altura
* @param mixed $strWidth - 6: NOT_IMPLEMENTED Largura
* @param mixed $strKeyField - 7: NOT_IMPLEMENTED Chave primaria
* @param array $mixUpdateFields - 8: NOT_IMPLEMENTED Campos do form origem que serão atualizados ao selecionar o item desejado. Separados por virgulas seguindo o padrão <campo_tabela> | <campo_formulario> , <campo_tabela> | <campo_formulario>
* @param mixed $intMaxRows - 9: NOT_IMPLEMENTED Qtd Max de linhas
Expand Down Expand Up @@ -153,30 +153,20 @@ public function __construct( $objForm
,$track[0]['file']
);
}else{
$this->validateDeprecated($strHeight,$strWidth);
$this->setObjForm($objForm);

$bootgrid = new BootstrapDatagridWrapper(new TDataGrid);
$bootgrid->width = '100%';
$this->setAdiantiObj($bootgrid);
$this->setId($strName);
$this->setHeight($strHeight);
//$this->setWidth($strWidth);

$panel = new TPanelGroup($strTitle);
$this->setPanelGroupGrid($panel);
}
}

public function validateDeprecated($strHeigh,$strWidth)
{
ValidateHelper::validadeParam('strHeigh',$strHeigh
,ValidateHelper::WARNING
,ValidateHelper::MSG_DECREP
,__CLASS__,__METHOD__,__LINE__);

ValidateHelper::validadeParam('strWidth',$strWidth
,ValidateHelper::WARNING
,ValidateHelper::MSG_DECREP
,__CLASS__,__METHOD__,__LINE__);
}

public function setObjForm($objForm)
{
Expand Down Expand Up @@ -207,6 +197,37 @@ public function getAdiantiObj(){
return $this->adiantiObj;
}

public function getId(){
return $this->idGrid;
}

public function setId(string $idGrid){
if(empty($idGrid)){
throw new InvalidArgumentException(TFormDinMessage::ERROR_EMPTY_INPUT);
}
$this->getAdiantiObj()->setId($idGrid);
$this->idGrid = $idGrid;
}

public function getHeight(){
return $this->getAdiantiObj()->height;
}

public function setHeight($Height){
$this->getAdiantiObj()->setHeight($Height);
}


public function getWidth()
{
//return $this->getAdiantiObj()->getWidth();
return null;
}
public function setWidth( $width )
{
//$this->getAdiantiObj()->setWidth($width);
}

public function setData( $data )
{
$this->data = $data;
Expand Down Expand Up @@ -260,17 +281,7 @@ public function setAction($action){
$this->action = $action;
}

public function getId(){
return $this->idGrid;
}

public function setId(string $idGrid){
if(empty($idGrid)){
throw new InvalidArgumentException(TFormDinMessage::ERROR_EMPTY_INPUT);
}
$this->getAdiantiObj()->setId($idGrid);
$this->idGrid = $idGrid;
}

public function getTitle(){
return $this->title;
Expand Down Expand Up @@ -366,53 +377,4 @@ public function addCheckColumn( $strName
$this->columns[ strtolower( $strName )] = $col;
return $col;
}

//------------------------------------------------------------------------------------
/**
* @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1
* @return void
*/
public function getWidth()
{
ValidateHelper::validadeParam('strWidth','deprecated'
,ValidateHelper::WARNING
,ValidateHelper::MSG_DECREP
,__CLASS__,__METHOD__,__LINE__);
}

/**
* @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1
* @return void
*/
public function setWidth( $strNewValue = null )
{
ValidateHelper::validadeParam('strWidth',$strNewValue
,ValidateHelper::WARNING
,ValidateHelper::MSG_DECREP
,__CLASS__,__METHOD__,__LINE__);
}

/**
* @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1
* @return void
*/
public function getHeight()
{
ValidateHelper::validadeParam('strWidth','deprecated'
,ValidateHelper::WARNING
,ValidateHelper::MSG_DECREP
,__CLASS__,__METHOD__,__LINE__);
}

/**
* @deprecated mantido apenas para diminir o impacto na migração do FormDin 4 para FormDin 5 sobre Adianti 7.1
* @return void
*/
public function setHeight( $strNewValue = null )
{
ValidateHelper::validadeParam('strHeight',$strNewValue
,ValidateHelper::WARNING
,ValidateHelper::MSG_DECREP
,__CLASS__,__METHOD__,__LINE__);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ protected function tearDown(): void {

public function testConstruct_Height()
{
$this->expectWarning();
$this->expectNotToPerformAssertions();
$mock = new StdClass;
$grid = new TFormDinGrid($mock,'grid',null,null,700);
}
public function testConstruct_Width()
{
$this->expectWarning();
$this->expectNotToPerformAssertions();
$mock = new StdClass;
$grid = new TFormDinGrid($mock,'grid',null,null,null,700);
}
Expand Down Expand Up @@ -136,25 +136,25 @@ public function testSetAdiantiObj_fail()

public function testGetWidth_fail()
{
$this->expectWarning();
$this->expectNotToPerformAssertions();
$this->classTest->getWidth();
}

public function testSetWidth_fail()
{
$this->expectWarning();
$this->expectNotToPerformAssertions();
$this->classTest->setWidth(100);
}

public function testGetHeight_fail()
{
$this->expectWarning();
$this->expectNotToPerformAssertions();
$this->classTest->getHeight();
}

public function testSetHeight_fail()
{
$this->expectWarning();
$this->expectNotToPerformAssertions();
$this->classTest->setHeight(100);
}

Expand Down

0 comments on commit 2d1e53e

Please sign in to comment.