mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7534 - Request to Improve the Display of an Inline Attachment (#664)
This commit is contained in:
@@ -30,6 +30,11 @@ class FileUploadField extends AbstractSimpleField
|
||||
{
|
||||
/** @var bool DEFAULT_ALLOW_DELETE */
|
||||
const DEFAULT_ALLOW_DELETE = true;
|
||||
/**
|
||||
* @var bool DEFAULT_DISPLAY_OPENED
|
||||
* @since 3.2.1 N°7534
|
||||
*/
|
||||
const DEFAULT_DISPLAY_OPENED = false;
|
||||
|
||||
/** @var string|null $sTransactionId */
|
||||
protected $sTransactionId;
|
||||
@@ -39,8 +44,18 @@ class FileUploadField extends AbstractSimpleField
|
||||
protected $sUploadEndpoint;
|
||||
/** @var string|null $sDownloadEndpoint */
|
||||
protected $sDownloadEndpoint;
|
||||
/**
|
||||
* @var string|null $sViewEndpoint
|
||||
* @since 3.2.1 N°7534
|
||||
*/
|
||||
protected ?string $sDisplayEndpoint;
|
||||
/** @var bool $bAllowDelete */
|
||||
protected $bAllowDelete;
|
||||
/**
|
||||
* @var bool $bDisplayOpened
|
||||
* @since 3.2.1 N°7534
|
||||
*/
|
||||
protected bool $bDisplayOpened;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -51,7 +66,9 @@ class FileUploadField extends AbstractSimpleField
|
||||
$this->oObject = null;
|
||||
$this->sUploadEndpoint = null;
|
||||
$this->sDownloadEndpoint = null;
|
||||
$this->sDisplayEndpoint = null;
|
||||
$this->bAllowDelete = static::DEFAULT_ALLOW_DELETE;
|
||||
$this->bDisplayOpened = static::DEFAULT_DISPLAY_OPENED;
|
||||
|
||||
parent::__construct($sId, $onFinalizeCallback);
|
||||
}
|
||||
@@ -134,6 +151,27 @@ class FileUploadField extends AbstractSimpleField
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @since 3.2.1 N°7534
|
||||
*/
|
||||
public function GetDisplayEndpoint(): ?string
|
||||
{
|
||||
return $this->sDisplayEndpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sDisplayEndpoint
|
||||
*
|
||||
* @return FileUploadField
|
||||
* @since 3.2.1 N°7534
|
||||
*/
|
||||
public function SetDisplayEndpoint(string $sDisplayEndpoint): FileUploadField
|
||||
{
|
||||
$this->sDisplayEndpoint = $sDisplayEndpoint;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
@@ -153,4 +191,29 @@ class FileUploadField extends AbstractSimpleField
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the field should be displayed opened on initialization
|
||||
*
|
||||
* @param bool $bDisplayOpened
|
||||
*
|
||||
* @return FileUploadField
|
||||
* @since 3.2.1 N°7534
|
||||
*/
|
||||
public function SetDisplayOpened(bool $bDisplayOpened) : FileUploadField
|
||||
{
|
||||
$this->bDisplayOpened = $bDisplayOpened;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the field should be displayed opened on initialization
|
||||
*
|
||||
* @return boolean
|
||||
* @since 3.2.1 N°7534
|
||||
*/
|
||||
public function GetDisplayOpened() : bool
|
||||
{
|
||||
return $this->bDisplayOpened;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user