diff --git a/application/utils.inc.php b/application/utils.inc.php index a9a4ce10c7..7208230801 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -2862,10 +2862,10 @@ HTML; * * @param string|null $sString * - * @return boolean if string null or empty + * @return bool if string null or empty * @since 3.0.2 N°5302 */ - public static function IsNullOrEmptyString(?string $sString): boolean + public static function IsNullOrEmptyString(?string $sString): bool { return $sString == null || strlen($sString) == 0; } @@ -2877,10 +2877,10 @@ HTML; * * @param string|null $sString * - * @return boolean if string is not null and not empty + * @return bool if string is not null and not empty * @since 3.0.2 N°5302 */ - public static function IsNotNullOrEmptyString(?string $sString): boolean + public static function IsNotNullOrEmptyString(?string $sString): bool { return !static::IsNullOrEmptyString($sString); } diff --git a/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml b/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml index d9ebd265b4..26d16e293d 100644 --- a/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml +++ b/datamodels/2.x/itop-oauth-client/datamodel.itop-oauth-client.xml @@ -1,6 +1,5 @@ - cmdbAbstractObject @@ -17,14 +16,15 @@ - - + @@ -121,18 +121,32 @@ Get('status') == 'inactive') { - $oPage->p(''.Dict::S('itop-oauth-client:Message:MissingToken').''); + $sLabel = Dict::S('itop-oauth-client:Message:MissingToken'); + $sTitle = ''; + $aTags['oauth-message'] = ['title' => $sTitle, 'css_classes' => 'ibo-object-details--tag--oauth-message', 'decoration_classes' => 'fas fa-exclamation-triangle', 'label' => $sLabel]; } elseif ($this->Get('used_for_smtp') == 'yes' && $oConfig->Get('email_transport_smtp.username') == $this->Get('name')) { $sLabel = Dict::S('itop-oauth-client:UsedForSMTP'); $sTestLabel = Dict::S('itop-oauth-client:TestSMTP'); $sTestURL = utils::GetAbsoluteUrlAppRoot().'setup/email.test.php'; - $oPage->p("$sLabel $sTestLabel"); + $sLabel = Dict::S('itop-oauth-client:UsedForSMTP')." $sTestLabel"; + $sTitle = ''; + $aTags['oauth-message'] = ['title' => $sTitle, 'css_classes' => 'ibo-object-details--tag--oauth-message', 'decoration_classes' => 'far fa-envelope', 'label' => $sLabel]; } } + foreach ($aTags as $sIconId => $aIconData) { + $sTagTooltipContent = utils::EscapeHtml($aIconData['title']); + $aHeaderBlocks['subtitle'][static::HEADER_BLOCKS_SUBTITLE_TAG_PREFIX.$sIconId] = new Combodo\iTop\Application\UI\Base\Component\Html\Html(<<{$aIconData['label']} + HTML + ); + } + + return $aHeaderBlocks; } ]]> @@ -294,8 +308,6 @@ - - @@ -312,13 +324,20 @@ true + true - SMTP - IMAP + + SMTP + + + IMAP + scope SMTP,IMAP @@ -332,8 +351,12 @@ true - simple - advanced + + simple + + + advanced + used_scope simple @@ -346,8 +369,12 @@ true - yes - no + + yes + + + no + used_for_smtp no @@ -594,8 +621,6 @@ - - @@ -612,13 +637,20 @@ true + true - SMTP - IMAP + + SMTP + + + IMAP + scope SMTP,IMAP @@ -632,8 +664,12 @@ true - simple - advanced + + simple + + + advanced + used_scope simple @@ -646,8 +682,12 @@ true - yes - no + + yes + + + no + used_for_smtp no @@ -899,7 +939,5 @@ - - diff --git a/datamodels/2.x/itop-oauth-client/src/Service/PopupMenuExtension.php b/datamodels/2.x/itop-oauth-client/src/Service/PopupMenuExtension.php index 31189de734..106b0ea83e 100644 --- a/datamodels/2.x/itop-oauth-client/src/Service/PopupMenuExtension.php +++ b/datamodels/2.x/itop-oauth-client/src/Service/PopupMenuExtension.php @@ -41,7 +41,7 @@ class PopupMenuExtension implements \iPopupMenuExtension $sId = $oObj->GetKey(); $sAjaxUri = utils::GetAbsoluteUrlModulePage(static::MODULE_CODE, 'ajax.php'); // Add a new menu item that triggers a custom JS function defined in our own javascript file: js/sample.js - $sJSFileUrl = utils::GetAbsoluteUrlModulesRoot().static::MODULE_CODE.'/assets/js/oauth_connect.js'; + $sJSFileUrl = 'env-'.utils::GetCurrentEnvironment().'/'.static::MODULE_CODE.'/assets/js/oauth_connect.js'; $sRedirectUri = OAuthClientProviderFactory::GetRedirectUri(); $aResult[] = new JSPopupMenuItem( $sMenu.' from '.$sObjClass, diff --git a/datamodels/2.x/itop-oauth-client/templates/CreateMailbox.html.twig b/datamodels/2.x/itop-oauth-client/templates/CreateMailbox.html.twig new file mode 100644 index 0000000000..578bce7b02 --- /dev/null +++ b/datamodels/2.x/itop-oauth-client/templates/CreateMailbox.html.twig @@ -0,0 +1,3 @@ +{# @copyright Copyright (C) 2010-2022 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} + diff --git a/datamodels/2.x/itop-oauth-client/templates/CreateMailbox.ready.js.twig b/datamodels/2.x/itop-oauth-client/templates/CreateMailbox.ready.js.twig new file mode 100644 index 0000000000..8b3d103309 --- /dev/null +++ b/datamodels/2.x/itop-oauth-client/templates/CreateMailbox.ready.js.twig @@ -0,0 +1,4 @@ +{# @copyright Copyright (C) 2010-2022 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} + +window.location.href = '{{ sURL|raw }}' \ No newline at end of file