diff --git a/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig b/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig index 54972f03a..faa34c9e9 100644 --- a/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig +++ b/datamodels/2.x/itop-core-update/view/SelectUpdateFile.html.twig @@ -14,9 +14,12 @@ {% UIFieldSet Standard {'sLegend':'iTopUpdate:UI:Status'|dict_s} %} {% UIAlert ForInformation {'sId':'header-requirements', 'IsCollapsible':false, 'IsClosable':false} %} +{% UIContentBlock Standard {'sContainerClass':'ibo-update-core-header-requirements', 'sId':'can-core-update'} %} {% UIHtml %} - {{ 'iTopUpdate:UI:CanCoreUpdate:Loading'|dict_s }} + {{ 'iTopUpdate:UI:CanCoreUpdate:Loading'|dict_s }} {% EndUIHtml %} +{% UISpinner Standard {} %} +{% EndUIContentBlock %} {% EndUIAlert %} {% UIField Standard {'sLabel':'iTopUpdate:UI:CurrentVersion'|dict_s} %} @@ -32,15 +35,11 @@ {% EndUIField %} {% UIField Standard {'sLabel':'iTopUpdate:UI:ItopDiskSpace'|dict_s, 'ValueId':'itop-disk-space'} %} -{% UIHtml %} - -{% EndUIHtml %} +{% UISpinner Standard {} %} {% EndUIField %} {% UIField Standard {'sLabel':'iTopUpdate:UI:DBDiskSpace'|dict_s, 'ValueId':'db-disk-space'} %} -{% UIHtml %} - -{% EndUIHtml %} +{% UISpinner Standard {} %} {% EndUIField %} {% UIField Standard {'sLabel':'iTopUpdate:UI:FileUploadMaxSize'|dict_s} %} @@ -56,41 +55,45 @@ {% UIInput ForHidden {'sName':'operation', 'sValue':'ConfirmUpdate'} %} {% UIInput ForHidden {'sName':'transaction_id', 'sValue':sTransactionId} %} +{% UIAlert ForFailure {'sId':'header-file-size', 'IsHidden':true} %} +{% UIContentBlock Standard {'sContainerClass':'ibo-file-size-error'} %} {% UIHtml %} -
+ {{ 'iTopUpdate:Error:FileUploadMaxSizeTooStandard'|dict_s }} {% EndUIHtml %} +{% EndUIContentBlock %} +{% UIContentBlock Standard {'sContainerClass':'ibo-file-size-error'} %} +{% UIHtml %} + {{ 'iTopUpdate:UI:PostMaxSize'|dict_format(sPostMaxSize) }} +{% EndUIHtml %} +{% EndUIContentBlock %} +{% UIContentBlock Standard {'sContainerClass':'ibo-file-size-error'} %} +{% UIHtml %} + {{ 'iTopUpdate:UI:UploadMaxFileSize'|dict_format(sUploadMaxSize) }} +{% EndUIHtml %} +{% EndUIContentBlock %} +{% EndUIAlert %} {% UIContentBlock Standard {'sContainerClass':'upload_container'} %} {% UIInput Standard {'sType':'file', 'sId':'file', 'sName':'file', 'sValue':''} %} {% EndUIContentBlock %} +{% UIAlert ForWarning {'sId':'dobackup-warning', 'IsHidden':true} %} {% UIHtml %} - + {{ 'iTopUpdate:UI:DoBackup:Warning'|dict_s }} {% EndUIHtml %} +{% EndUIAlert %} {% UIField Standard {'sLabel':'iTopUpdate:UI:DoBackup:Label'|dict_s, 'sLayout':'large'} %} -{% UIInput Standard {'sType':'checkbox', 'sId':'doBackup', 'sName':'doBackup', 'sValue':'1', 'Checked':true} %} +{% UIInput Standard {'sType':'checkbox', 'sId':'doBackup', 'sName':'doBackup', 'sValue':'1', 'IsChecked':true} %} {% EndUIField %} {% UIField Standard {'sLabel':'iTopUpdate:UI:DoFilesArchive'|dict_s, 'sLayout':'large'} %} -{% UIInput Standard {'sType':'checkbox', 'sId':'doFilesArchive', 'sName':'doFilesArchive', 'sValue':'1', 'Checked':true} %} +{% UIInput Standard {'sType':'checkbox', 'sId':'doFilesArchive', 'sName':'doFilesArchive', 'sValue':'1', 'IsChecked':true} %} {% EndUIField %} {% UIContentBlock Standard {'sContainerClass':'ibo_check_update_submit'} %} {% UIButton ForPrimaryAction {'sLabel':'iTopUpdate:UI:CheckUpdate'|dict_s, 'sId':'check-update', 'bIsSubmit':true, 'IsDisabled':true} %} -{% UIHtml %} - -{% EndUIHtml %} +{% UISpinner Standard {'sId':'submit-wait', 'IsHidden':true} %} {% EndUIContentBlock %} {% EndUIForm %} @@ -104,6 +107,5 @@ {% EndUIFieldSet %} {% EndUIContentBlock %} - {% EndUIContentBlock %} {% endapply %} \ No newline at end of file diff --git a/lib/composer/autoload_classmap.php b/lib/composer/autoload_classmap.php index 2d92e14b5..9ddbd541d 100644 --- a/lib/composer/autoload_classmap.php +++ b/lib/composer/autoload_classmap.php @@ -211,6 +211,8 @@ return array( 'Combodo\\iTop\\Application\\UI\\Base\\Component\\QuickCreate\\QuickCreate' => $baseDir . '/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\QuickCreate\\QuickCreateFactory' => $baseDir . '/sources/application/UI/Base/Component/QuickCreate/QuickCreateFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\QuickCreate\\QuickCreateHelper' => $baseDir . '/sources/application/UI/Base/Component/QuickCreate/QuickCreateHelper.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Spinner\\Spinner' => $baseDir . '/sources/application/UI/Base/Component/Spinner/Spinner.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Spinner\\SpinnerUIBlockFactory' => $baseDir . '/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Title\\Title' => $baseDir . '/sources/application/UI/Base/Component/Title/Title.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Title\\TitleForObjectDetails' => $baseDir . '/sources/application/UI/Base/Component/Title/TitleForObjectDetails.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Title\\TitleUIBlockFactory' => $baseDir . '/sources/application/UI/Base/Component/Title/TitleUIBlockFactory.php', diff --git a/lib/composer/autoload_static.php b/lib/composer/autoload_static.php index 9f24e6f82..b8e56e8e4 100644 --- a/lib/composer/autoload_static.php +++ b/lib/composer/autoload_static.php @@ -441,6 +441,8 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b 'Combodo\\iTop\\Application\\UI\\Base\\Component\\QuickCreate\\QuickCreate' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/QuickCreate/QuickCreate.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\QuickCreate\\QuickCreateFactory' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/QuickCreate/QuickCreateFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\QuickCreate\\QuickCreateHelper' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/QuickCreate/QuickCreateHelper.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Spinner\\Spinner' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Spinner/Spinner.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Spinner\\SpinnerUIBlockFactory' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Title\\Title' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Title/Title.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Title\\TitleForObjectDetails' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Title/TitleForObjectDetails.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Title\\TitleUIBlockFactory' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Title/TitleUIBlockFactory.php', diff --git a/sources/application/UI/Base/Component/Alert/Alert.php b/sources/application/UI/Base/Component/Alert/Alert.php index 568afc735..7cb6938bd 100644 --- a/sources/application/UI/Base/Component/Alert/Alert.php +++ b/sources/application/UI/Base/Component/Alert/Alert.php @@ -84,6 +84,8 @@ class Alert extends UIContentBlock public const DEFAULT_IS_COLLAPSIBLE = true; /** @var bool Default value for static::$bIsOpenedByDefault */ public const DEFAULT_IS_OPENED_BY_DEFAULT = true; + /** @var bool Default value for static::$bIsHidden */ + public const DEFAULT_IS_HIDDEN = false; /** @var string $sTitle */ protected $sTitle; @@ -93,6 +95,8 @@ class Alert extends UIContentBlock protected $bIsClosable; /** @var bool Whether the alert can be collapsed or not */ protected $bIsCollapsible; + /** @var bool Whether the alert is hidden or not */ + protected $bIsHidden; /** @var bool Whether the alert is opened by default or not, only works when $bIsCollapsible set to true */ protected $bIsOpenedByDefault; /** @var boolean if true will store collapsible state */ @@ -116,6 +120,7 @@ class Alert extends UIContentBlock $this->bIsClosable = static::DEFAULT_IS_CLOSABLE; $this->bIsCollapsible = static::DEFAULT_IS_COLLAPSIBLE; $this->bIsOpenedByDefault = static::DEFAULT_IS_OPENED_BY_DEFAULT; + $this->bIsHidden = static::DEFAULT_IS_HIDDEN; if (!empty($sContent)) { $this->AddSubBlock(new Html($sContent)); } @@ -275,4 +280,25 @@ class Alert extends UIContentBlock { return $this->sSectionStateStorageKey; } + + /** + * @return bool + */ + public function IsHidden(): bool + { + return $this->bIsHidden; + } + + /** + * @param bool $bIsHidden + * + * @return $this + */ + public function SetIsHidden(bool $bIsHidden) + { + $this->bIsHidden = $bIsHidden; + return $this; + } + + } \ No newline at end of file diff --git a/sources/application/UI/Base/Component/Input/Input.php b/sources/application/UI/Base/Component/Input/Input.php index 003ed8bb8..4daa4e008 100644 --- a/sources/application/UI/Base/Component/Input/Input.php +++ b/sources/application/UI/Base/Component/Input/Input.php @@ -20,7 +20,7 @@ class Input extends AbstractInput public const INPUT_HIDDEN = 'hidden'; - protected $bChecked = false; + protected $bIsChecked = false; /** @var string */ protected $sType; @@ -47,9 +47,9 @@ class Input extends AbstractInput * * @return $this */ - public function SetChecked($bChecked) + public function SetIsChecked($bIsChecked) { - $this->bChecked = $bChecked; + $this->bIsChecked = $bIsChecked; return $this; } @@ -58,6 +58,6 @@ class Input extends AbstractInput */ public function IsChecked() { - return $this->bChecked; + return $this->bIsChecked; } } \ No newline at end of file diff --git a/sources/application/UI/Base/Component/Spinner/Spinner.php b/sources/application/UI/Base/Component/Spinner/Spinner.php new file mode 100644 index 000000000..d18da033f --- /dev/null +++ b/sources/application/UI/Base/Component/Spinner/Spinner.php @@ -0,0 +1,51 @@ +bIsHidden = false; + } + + /** + * @return false + */ + public function IsHidden(): bool + { + return $this->bIsHidden; + } + + /** + * @param false $bIsHidden + * + * @return $this + */ + public function SetIsHidden(bool $bIsHidden) + { + $this->bIsHidden = $bIsHidden; + return $this; + } + + +} \ No newline at end of file diff --git a/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php b/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php new file mode 100644 index 000000000..e69bad341 --- /dev/null +++ b/sources/application/UI/Base/Component/Spinner/SpinnerUIBlockFactory.php @@ -0,0 +1,22 @@ + + class="ibo-alert ibo-is-{{ oUIBlock.GetColor() }}{% if oUIBlock.IsOpenedByDefault() %} ibo-is-opened{% endif %}" + {% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}> {% if oUIBlock.IsCollapsible() %}