Merge remote-tracking branch 'origin/support/3.0' into develop

This commit is contained in:
Pierre Goiffon
2022-11-29 19:04:04 +01:00
2 changed files with 19 additions and 5 deletions

View File

@@ -1654,6 +1654,18 @@ JS
return array_key_exists('itsm-designer-connector', $aModules); return array_key_exists('itsm-designer-connector', $aModules);
} }
/**
* @param array $aModules List of available module codes
*
* @return bool true if the Hub connector is installed
*
* @since 2.7.8 3.0.3 3.1.0 N°5758 method creation
*/
public static function IsConnectableToITopHub($aModules)
{
return array_key_exists('itop-hub-connector', $aModules);
}
/** /**
* @param array $aModules Available modules with code as key and metadata array as values * @param array $aModules Available modules with code as key and metadata array as values
* Same structure as the one returned by {@link \RunTimeEnvironment::AnalyzeInstallation} * Same structure as the one returned by {@link \RunTimeEnvironment::AnalyzeInstallation}

View File

@@ -680,15 +680,17 @@ class WizStepLicense extends WizardStep
} }
/** /**
* @return bool * @return bool true if we need to display a GDPR confirmation
* @throws \Exception * @throws \Exception
* @since 2.7.7 3.0.2 3.1.0 * @since 2.7.7 3.0.2 3.1.0 N°5037 method creation
* @since 2.7.8 3.0.3 3.1.0 N°5758 rename from NeedsRgpdConsent to NeedsGdprConsent
*/ */
private function NeedsRgpdConsent() private function NeedsGdprConsent()
{ {
$sMode = $this->oWizard->GetParameter('install_mode'); $sMode = $this->oWizard->GetParameter('install_mode');
$aModules = SetupUtils::AnalyzeInstallation($this->oWizard); $aModules = SetupUtils::AnalyzeInstallation($this->oWizard);
return $sMode == 'install' && !SetupUtils::IsProductVersion($aModules);
return (($sMode === 'install') && SetupUtils::IsConnectableToITopHub($aModules));
} }
/** /**
@@ -724,7 +726,7 @@ CSS
$oPage->add('</fieldset>'); $oPage->add('</fieldset>');
$sChecked = ($this->oWizard->GetParameter('accept_license', 'no') == 'yes') ? ' checked ' : ''; $sChecked = ($this->oWizard->GetParameter('accept_license', 'no') == 'yes') ? ' checked ' : '';
$oPage->add('<div class="setup-accept-licenses"><input class="check_select" type="checkbox" name="accept_license" id="accept" value="yes" '.$sChecked.'><label for="accept">I accept the terms of the licenses of the '.count($aLicenses).' components mentioned above.</label></div>'); $oPage->add('<div class="setup-accept-licenses"><input class="check_select" type="checkbox" name="accept_license" id="accept" value="yes" '.$sChecked.'><label for="accept">I accept the terms of the licenses of the '.count($aLicenses).' components mentioned above.</label></div>');
if ($this->NeedsRgpdConsent()) { if ($this->NeedsGdprConsent()) {
$oPage->add('<br>'); $oPage->add('<br>');
$oPage->add('<fieldset>'); $oPage->add('<fieldset>');
$oPage->add('<legend>European General Data Protection Regulation</legend>'); $oPage->add('<legend>European General Data Protection Regulation</legend>');