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

# Conflicts:
#	setup/wizardsteps.class.inc.php
This commit is contained in:
Pierre Goiffon
2022-11-29 19:02:51 +01:00
2 changed files with 19 additions and 5 deletions

View File

@@ -1666,6 +1666,18 @@ JS
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
* Same structure as the one returned by {@link \RunTimeEnvironment::AnalyzeInstallation}

View File

@@ -694,15 +694,17 @@ class WizStepLicense extends WizardStep
}
/**
* @return bool
* @return bool true if we need to display a GDPR confirmation
* @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');
$aModules = SetupUtils::AnalyzeInstallation($this->oWizard);
return $sMode == 'install' && !SetupUtils::IsProductVersion($aModules);
return (($sMode === 'install') && SetupUtils::IsConnectableToITopHub($aModules));
}
/**
@@ -738,7 +740,7 @@ CSS
$oPage->add('</fieldset>');
$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>');
if ($this->NeedsRgpdConsent()) {
if ($this->NeedsGdprConsent()) {
$oPage->add('<br>');
$oPage->add('<fieldset>');
$oPage->add('<legend>European General Data Protection Regulation</legend>');