mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-06 22:08:19 +02:00
Compare commits
12 Commits
feature/88
...
faf/faf-da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae4ed11729 | ||
|
|
42ade7e1be | ||
|
|
4ce0cd7173 | ||
|
|
eeb1312127 | ||
|
|
13fad9efc1 | ||
|
|
9fbc53cf00 | ||
|
|
918f110dc9 | ||
|
|
8e0246601a | ||
|
|
bd9cc9c15e | ||
|
|
60ce21509f | ||
|
|
e6cdcd0a5a | ||
|
|
2ab3081926 |
@@ -5368,6 +5368,7 @@ JS
|
||||
/**
|
||||
* @param array $aChanges
|
||||
* @param bool $bIsNew
|
||||
* @param string|null $sStimulusBeingApplied
|
||||
*
|
||||
* @return void
|
||||
* @throws \ArchivedObjectException
|
||||
@@ -5381,6 +5382,20 @@ JS
|
||||
$this->FireEvent(EVENT_DB_AFTER_WRITE, ['is_new' => $bIsNew, 'changes' => $aChanges, 'stimulus_applied' => $sStimulusBeingApplied, 'cmdb_change' => self::GetCurrentChange()]);
|
||||
}
|
||||
|
||||
//////////////
|
||||
/// READ
|
||||
///
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \CoreException
|
||||
* @since 3.3.0
|
||||
*/
|
||||
final public function FireEventReadDetails(string $sExportType): void
|
||||
{
|
||||
$this->FireEvent(EVENT_DATA_EXPORT, ['export_type' => $sExportType]);
|
||||
}
|
||||
|
||||
//////////////
|
||||
/// DELETE
|
||||
///
|
||||
|
||||
@@ -519,6 +519,31 @@ Call $this->AddInitialAttributeFlags($sAttCode, $iFlags) for all the initial att
|
||||
</event_datum>
|
||||
</event_data>
|
||||
</event>
|
||||
<event id="EVENT_DATA_EXPORT" _delta="define">
|
||||
<name>Object details read from outside iTop</name>
|
||||
<description><![CDATA[An object details has been read during an export]]></description>
|
||||
<sources>
|
||||
<source id="cmdbAbstractObject">cmdbAbstractObject</source>
|
||||
</sources>
|
||||
<event_data>
|
||||
<event_datum id="object">
|
||||
<description>The object unarchived</description>
|
||||
<type>DBObject</type>
|
||||
</event_datum>
|
||||
<event_datum id="attributes">
|
||||
<description>Attribute codes exposed (empty means potentially all attributes)</description>
|
||||
<type>array</type>
|
||||
</event_datum>
|
||||
<event_datum id="export_type">
|
||||
<description>Type of export</description>
|
||||
<type>string</type>
|
||||
</event_datum>
|
||||
<event_datum id="debug_info">
|
||||
<description>Debug string</description>
|
||||
<type>string</type>
|
||||
</event_datum>
|
||||
</event_data>
|
||||
</event>
|
||||
<event id="EVENT_DOWNLOAD_DOCUMENT" _delta="define">
|
||||
<name>Document downloaded</name>
|
||||
<description><![CDATA[A document has been downloaded from the GUI]]></description>
|
||||
|
||||
@@ -25,11 +25,11 @@
|
||||
*/
|
||||
|
||||
use Combodo\iTop\Application\Branding;
|
||||
use Combodo\iTop\Application\Helper\Session;
|
||||
use Combodo\iTop\Application\WebPage\ErrorPage;
|
||||
use Combodo\iTop\Application\WebPage\NiceWebPage;
|
||||
use Combodo\iTop\Service\Events\EventData;
|
||||
use Combodo\iTop\Service\Events\EventService;
|
||||
use Combodo\iTop\Service\Session\Session;
|
||||
|
||||
/**
|
||||
* Web page used for displaying the login form
|
||||
@@ -369,16 +369,7 @@ class LoginWebPage extends NiceWebPage
|
||||
public static function ResetSession()
|
||||
{
|
||||
// Unset all of the session variables.
|
||||
Session::Unset('auth_user');
|
||||
Session::Unset('login_state');
|
||||
Session::Unset('can_logoff');
|
||||
Session::Unset('archive_mode');
|
||||
Session::Unset('impersonate_user');
|
||||
Session::Unset('PluginProperties');
|
||||
Session::Unset('UrlMakerClass');
|
||||
Session::Unset('itop_env');
|
||||
Session::Unset('obj_messages');
|
||||
Session::Unset('profile_list');
|
||||
Session::UnsetAll();
|
||||
UserRights::_ResetSessionCache();
|
||||
// If it's desired to kill the session, also delete the session cookie.
|
||||
// Note: This will destroy the session, and not just the session data!
|
||||
|
||||
@@ -334,12 +334,14 @@ EOF
|
||||
while ($aRow = $oSet->FetchAssoc()) {
|
||||
set_time_limit(intval($iLoopTimeLimit));
|
||||
$aData = [];
|
||||
foreach ($this->aStatusInfo['fields'] as $iCol => $aFieldSpec) {
|
||||
$aExportedObjects = [];
|
||||
foreach ($this->aStatusInfo['fields'] as $aFieldSpec) {
|
||||
$sAlias = $aFieldSpec['sAlias'];
|
||||
$sAttCode = $aFieldSpec['sAttCode'];
|
||||
|
||||
$sField = '';
|
||||
$oObj = $aRow[$sAlias];
|
||||
$aExportedObjects[] = $oObj;
|
||||
if ($oObj != null) {
|
||||
switch ($sAttCode) {
|
||||
case 'id':
|
||||
@@ -366,7 +368,13 @@ EOF
|
||||
}
|
||||
$sData .= implode($this->aStatusInfo['separator'], $aData)."\n";
|
||||
$iCount++;
|
||||
|
||||
$aExportedObjects = array_unique($aExportedObjects);
|
||||
foreach ($aExportedObjects as $oExportedObject) {
|
||||
$oExportedObject->FireEventReadDetails(get_class($this));
|
||||
}
|
||||
}
|
||||
|
||||
// Restore original date & time formats
|
||||
AttributeDateTime::SetFormat($oPrevDateTimeFormat);
|
||||
AttributeDate::SetFormat($oPrevDateFormat);
|
||||
|
||||
@@ -6247,7 +6247,9 @@ abstract class DBObject implements iDisplay
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aChanges
|
||||
* @param bool $bIsNew
|
||||
* @param string|null $sStimulusBeingApplied
|
||||
*
|
||||
* @return void
|
||||
* @since 3.1.0
|
||||
@@ -6256,6 +6258,18 @@ abstract class DBObject implements iDisplay
|
||||
{
|
||||
}
|
||||
|
||||
//////////////
|
||||
/// READ
|
||||
///
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public function FireEventReadDetails(string $sExportType): void
|
||||
{
|
||||
}
|
||||
|
||||
//////////////
|
||||
/// DELETE
|
||||
///
|
||||
|
||||
@@ -288,11 +288,13 @@ EOF
|
||||
while ($aRow = $oSet->FetchAssoc()) {
|
||||
set_time_limit(intval($iLoopTimeLimit));
|
||||
$aData = [];
|
||||
$aExportedObjects = [];
|
||||
foreach ($this->aStatusInfo['fields'] as $iCol => $aFieldSpec) {
|
||||
$sAlias = $aFieldSpec['sAlias'];
|
||||
$sAttCode = $aFieldSpec['sAttCode'];
|
||||
|
||||
$oObj = $aRow[$sAlias];
|
||||
$aExportedObjects[] = $oObj;
|
||||
$sField = '';
|
||||
if ($oObj) {
|
||||
$sField = $this->GetValue($oObj, $sAttCode);
|
||||
@@ -301,6 +303,11 @@ EOF
|
||||
}
|
||||
fwrite($hFile, json_encode($aData)."\n");
|
||||
$iCount++;
|
||||
|
||||
$aExportedObjects = array_unique($aExportedObjects);
|
||||
foreach ($aExportedObjects as $oExportedObject) {
|
||||
$oExportedObject->FireEventReadDetails(get_class($this));
|
||||
}
|
||||
}
|
||||
set_time_limit(intval($iPreviousTimeLimit));
|
||||
$this->aStatusInfo['position'] += $this->iChunkSize;
|
||||
|
||||
@@ -139,6 +139,7 @@ class HTMLBulkExport extends TabularBulkExport
|
||||
} else {
|
||||
$sData .= "<tr>";
|
||||
}
|
||||
$aExportedObjects = [];
|
||||
foreach ($this->aStatusInfo['fields'] as $iCol => $aFieldSpec) {
|
||||
$sAlias = $aFieldSpec['sAlias'];
|
||||
$sAttCode = $aFieldSpec['sAttCode'];
|
||||
@@ -147,12 +148,18 @@ class HTMLBulkExport extends TabularBulkExport
|
||||
$sField = '';
|
||||
if ($oObj) {
|
||||
$sField = $this->GetValue($oObj, $sAttCode);
|
||||
$aExportedObjects[] = $oObj;
|
||||
}
|
||||
$sValue = ($sField === '') ? ' ' : $sField;
|
||||
$sData .= "<td>$sValue</td>";
|
||||
}
|
||||
$sData .= "</tr>";
|
||||
$iCount++;
|
||||
|
||||
$aExportedObjects = array_unique($aExportedObjects);
|
||||
foreach ($aExportedObjects as $oExportedObject) {
|
||||
$oExportedObject->FireEventReadDetails(get_class($this));
|
||||
}
|
||||
}
|
||||
set_time_limit(intval($iPreviousTimeLimit));
|
||||
$this->aStatusInfo['position'] += $this->iChunkSize;
|
||||
|
||||
@@ -625,6 +625,7 @@ class CoreServices implements iRestServiceProvider, iRestInputSanitizer
|
||||
}
|
||||
|
||||
while ($oObject = $oObjectSet->Fetch()) {
|
||||
$oObject->FireEventReadDetails(get_class($this));
|
||||
$oResult->AddObject(0, '', $oObject, $aShowFields, RestUtils::HasRequestedExtendedOutput($sShowFields));
|
||||
}
|
||||
$oResult->message = "Found: ".$oObjectSet->Count();
|
||||
@@ -699,6 +700,7 @@ class CoreServices implements iRestServiceProvider, iRestInputSanitizer
|
||||
if ($oElement instanceof RelationObjectNode) {
|
||||
$oObject = $oElement->GetProperty('object');
|
||||
if ($oObject) {
|
||||
$oObject->FireEventReadDetails(get_class($this));
|
||||
if ($bEnableRedundancy && $sDirection == 'down') {
|
||||
// Add only the "reached" objects
|
||||
if ($oElement->GetProperty('is_reached')) {
|
||||
|
||||
@@ -233,7 +233,6 @@ EOF
|
||||
public function GetNextChunk(&$aStatus)
|
||||
{
|
||||
$sRetCode = 'run';
|
||||
$iPercentage = 0;
|
||||
|
||||
$oSet = new DBObjectSet($this->oSearch);
|
||||
$oSet->SetLimit($this->iChunkSize, $this->aStatusInfo['position']);
|
||||
@@ -254,7 +253,8 @@ EOF
|
||||
set_time_limit(intval($iLoopTimeLimit));
|
||||
|
||||
$sData .= "<tr>";
|
||||
foreach ($this->aStatusInfo['fields'] as $iCol => $aFieldSpec) {
|
||||
$aExportedObjects = [];
|
||||
foreach ($this->aStatusInfo['fields'] as $aFieldSpec) {
|
||||
$sAlias = $aFieldSpec['sAlias'];
|
||||
$sAttCode = $aFieldSpec['sAttCode'];
|
||||
|
||||
@@ -265,7 +265,7 @@ EOF
|
||||
$sData .= "<td x:str></td>";
|
||||
continue;
|
||||
}
|
||||
|
||||
$aExportedObjects[] = $oObj;
|
||||
switch ($sAttCode) {
|
||||
case 'id':
|
||||
$sField = $oObj->GetKey();
|
||||
@@ -322,6 +322,11 @@ EOF
|
||||
}
|
||||
$sData .= "</tr>";
|
||||
$iCount++;
|
||||
|
||||
$aExportedObjects = array_unique($aExportedObjects);
|
||||
foreach ($aExportedObjects as $oExportedObject) {
|
||||
$oExportedObject->FireEventReadDetails(get_class($this));
|
||||
}
|
||||
}
|
||||
set_time_limit(intval($iPreviousTimeLimit));
|
||||
$this->aStatusInfo['position'] += $this->iChunkSize;
|
||||
|
||||
@@ -8,13 +8,6 @@
|
||||
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
|
||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlockUIBlockFactory;
|
||||
use Combodo\iTop\Application\WebPage\WebPage;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeExternalField;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeExternalKey;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeFriendlyName;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeHierarchicalKey;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeLinkedSet;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeStopWatch;
|
||||
use Combodo\iTop\Core\AttributeDefinition\AttributeSubItem;
|
||||
|
||||
/**
|
||||
* Bulk export: Tabular export: abstract base class for all "tabular" exports.
|
||||
@@ -98,8 +91,8 @@ abstract class TabularBulkExport extends BulkExport
|
||||
{
|
||||
$aResult = [];
|
||||
switch (get_class($oAttDef)) {
|
||||
case AttributeExternalKey::class:
|
||||
case AttributeHierarchicalKey::class:
|
||||
case 'AttributeExternalKey':
|
||||
case 'AttributeHierarchicalKey':
|
||||
|
||||
$bAddFriendlyName = true;
|
||||
$oKeyAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||
@@ -149,7 +142,7 @@ abstract class TabularBulkExport extends BulkExport
|
||||
}
|
||||
break;
|
||||
|
||||
case AttributeStopWatch::class:
|
||||
case 'AttributeStopWatch':
|
||||
foreach (MetaModel::ListAttributeDefs($sClass) as $sSubAttCode => $oSubAttDef) {
|
||||
if ($oSubAttDef instanceof AttributeSubItem) {
|
||||
if ($oSubAttDef->GetParentAttCode() == $sAttCode) {
|
||||
|
||||
@@ -135,6 +135,11 @@ abstract class Trigger extends cmdbAbstractObject
|
||||
if ($oAction->IsActive()) {
|
||||
$oKPI = new ExecutionKPI();
|
||||
$aContextArgs['action->object()'] = $oAction;
|
||||
if (array_key_exists('this->object()', $aContextArgs)) {
|
||||
/** @var \DBObject $oObject */
|
||||
$oObject = $aContextArgs['this->object()'];
|
||||
$oObject->FireEventReadDetails(get_class($oAction));
|
||||
}
|
||||
$oAction->DoExecute($this, $aContextArgs);
|
||||
$oKPI->ComputeStatsForExtension($oAction, 'DoExecute');
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ class XMLBulkExport extends BulkExport
|
||||
if (count($aAuthorizedClasses) > 1) {
|
||||
$sData .= "<Row>\n";
|
||||
}
|
||||
$aExportedObjects = [];
|
||||
foreach ($aAuthorizedClasses as $sAlias => $sClassName) {
|
||||
$oObj = $aObjects[$sAlias];
|
||||
if (is_null($oObj)) {
|
||||
@@ -151,6 +152,7 @@ class XMLBulkExport extends BulkExport
|
||||
} else {
|
||||
$sClassName = get_class($oObj);
|
||||
$sData .= "<$sClassName alias=\"$sAlias\" id=\"".$oObj->GetKey()."\">\n";
|
||||
$aExportedObjects[] = $oObj;
|
||||
}
|
||||
foreach ($aClass2Attributes[$sAlias] as $sAttCode => $oAttDef) {
|
||||
if (is_null($oObj)) {
|
||||
@@ -166,6 +168,11 @@ class XMLBulkExport extends BulkExport
|
||||
$sData .= "</Row>\n";
|
||||
}
|
||||
$iCount++;
|
||||
|
||||
$aExportedObjects = array_unique($aExportedObjects);
|
||||
foreach ($aExportedObjects as $oExportedObject) {
|
||||
$oExportedObject->FireEventReadDetails(get_class($this));
|
||||
}
|
||||
}
|
||||
|
||||
set_time_limit(intval($iPreviousTimeLimit));
|
||||
|
||||
@@ -127,6 +127,9 @@ class DataFeatureRemovalController extends Controller
|
||||
|
||||
$aRemovedExtensions = $this->aExtensionsToCheck['to_be_removed'];
|
||||
$aHiddenInputs['removed_extensions'] = $this->ConvertIntoSetupFormat($aRemovedExtensions);
|
||||
|
||||
$aExtensionsNotUninstallable = $this->aExtensionsToCheck['extensions_not_uninstallable'];
|
||||
$aHiddenInputs['extensions_not_uninstallable'] = $this->ConvertIntoSetupFormat($aExtensionsNotUninstallable);
|
||||
}
|
||||
|
||||
$aParams['aAddedExtensions'] = $aAddedExtensions;
|
||||
@@ -344,7 +347,7 @@ class DataFeatureRemovalController extends Controller
|
||||
'uninstallable' => $oExtension->CanBeUninstalled(),
|
||||
'remote' => $oExtension->IsRemote(),
|
||||
'missing' => $oExtension->bRemovedFromDisk,
|
||||
'cannot-be-installed' => count($oExtension->aMissingDependencies) > 0,
|
||||
'cannot-be-installed' => $oExtension->HasDependencyIssue(),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -425,6 +428,7 @@ class DataFeatureRemovalController extends Controller
|
||||
$this->aExtensionsToCheck = [
|
||||
'to_be_installed' => [],
|
||||
'to_be_removed' => [],
|
||||
'extensions_not_uninstallable' => [],
|
||||
];
|
||||
foreach ($aAvailableExtensions as $sCode => &$aExtensionData) {
|
||||
if (!isset($aSelectedExtensionsFromUI[$sCode])) {
|
||||
@@ -438,6 +442,9 @@ class DataFeatureRemovalController extends Controller
|
||||
if (! $this->bForcedUninstallation && $aExtensionData['extra_flags']['uninstallable']) {
|
||||
$this->bForcedUninstallation = true;
|
||||
}
|
||||
if (false === $aExtensionData['extra_flags']['uninstallable']) {
|
||||
$this->aExtensionsToCheck['extensions_not_uninstallable'][] = $sCode;
|
||||
}
|
||||
} elseif (!$aExtensionData['installed'] && $aSelectedExtensionsFromUI[$sCode] === 'on') {
|
||||
$aExtensionData['extra_flags']['selected'] = true;
|
||||
$sLabel = $aAvailableExtensions[$sCode]['label'];
|
||||
|
||||
@@ -159,7 +159,7 @@ function DoInstall(WebPage $oPage)
|
||||
|
||||
foreach ($oExtensionsMap->GetAllExtensions() as $oExtension) {
|
||||
if ($oExtension->sSource == iTopExtension::SOURCE_REMOTE) {
|
||||
if (count($oExtension->aMissingDependencies) > 0) {
|
||||
if ($oExtension->HasDependencyIssue()) {
|
||||
$oPage->add('<div class="choice">');
|
||||
$oPage->add('<input type="checkbox" disabled> ');
|
||||
$sTitle = Dict::Format('iTopHub:InstallationEffect:MissingDependencies_Details', implode(', ', $oExtension->aMissingDependencies));
|
||||
|
||||
@@ -49,8 +49,6 @@ if (Session::IsSet('auth_user')) {
|
||||
UserRights::Login($sAuthUser); // Set the user's language
|
||||
}
|
||||
|
||||
LoginWebPage::ResetSession();
|
||||
|
||||
$bLoginDebug = MetaModel::GetConfig()->Get('login_debug');
|
||||
if ($bLoginDebug) {
|
||||
IssueLog::Info("---------------------------------");
|
||||
@@ -88,7 +86,7 @@ if ($bLoginDebug) {
|
||||
IssueLog::Info("--> Display logout page");
|
||||
}
|
||||
|
||||
LoginWebPage::ResetSession(true);
|
||||
LoginWebPage::ResetSession();
|
||||
if ($bLoginDebug) {
|
||||
$sSessionLog = session_id().' '.utils::GetSessionLog();
|
||||
IssueLog::Info("SESSION: $sSessionLog");
|
||||
|
||||
@@ -545,7 +545,7 @@ class iTopExtensionsMap
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! $bKeepExtensionsHavingMissingDependencies && count($oExtension->aMissingDependencies) > 0) {
|
||||
if (! $bKeepExtensionsHavingMissingDependencies && $oExtension->HasDependencyIssue()) {
|
||||
//skip extensions with dependency issues
|
||||
continue;
|
||||
}
|
||||
@@ -562,19 +562,20 @@ class iTopExtensionsMap
|
||||
public function GetAllExtensionsOptionInfo(bool $bRemoteExtensionsShouldBeMandatory = true): array
|
||||
{
|
||||
$aRes = [];
|
||||
foreach ($this->GetAllExtensionsToDisplayInSetup(false, $bRemoteExtensionsShouldBeMandatory) as $sCode => $oExtension) {
|
||||
foreach ($this->GetAllExtensionsToDisplayInSetup(true, $bRemoteExtensionsShouldBeMandatory) as $sCode => $oExtension) {
|
||||
$aRes[] = [
|
||||
'extension_code' => $oExtension->sCode,
|
||||
'title' => $oExtension->sLabel,
|
||||
'description' => $oExtension->sDescription,
|
||||
'more_info' => $oExtension->sMoreInfoUrl,
|
||||
'default' => true, // by default offer to install all modules
|
||||
'modules' => $oExtension->aModules,
|
||||
'mandatory' => $oExtension->bMandatory,
|
||||
'source_label' => $oExtension->GetExtensionSourceLabel(),
|
||||
'uninstallable' => $oExtension->CanBeUninstalled(),
|
||||
'missing' => $oExtension->bRemovedFromDisk,
|
||||
'version' => $oExtension->sVersion,
|
||||
'extension_code' => $oExtension->sCode,
|
||||
'title' => $oExtension->sLabel,
|
||||
'description' => $oExtension->sDescription,
|
||||
'more_info' => $oExtension->sMoreInfoUrl,
|
||||
'default' => true, // by default offer to install all modules
|
||||
'modules' => $oExtension->aModules,
|
||||
'mandatory' => $oExtension->bMandatory,
|
||||
'dependency_issue' => $oExtension->HasDependencyIssue(),
|
||||
'source_label' => $oExtension->GetExtensionSourceLabel(),
|
||||
'uninstallable' => $oExtension->CanBeUninstalled(),
|
||||
'missing' => $oExtension->bRemovedFromDisk,
|
||||
'version' => $oExtension->sVersion,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -200,4 +200,9 @@ class iTopExtension
|
||||
{
|
||||
return $this->sLabel !== '';
|
||||
}
|
||||
|
||||
public function HasDependencyIssue(): bool
|
||||
{
|
||||
return count($this->aMissingDependencies) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1661,11 +1661,14 @@ JS
|
||||
|
||||
$aAvailableModules = $oProductionEnv->AnalyzeInstallation($oConfig, $aDirsToScan, $bAbortOnMissingDependency, $aModulesToLoad);
|
||||
|
||||
foreach ($aAvailableModules as $key => $aModule) {
|
||||
$bIsExtra = (array_key_exists('root_dir', $aModule) && (strpos($aModule['root_dir'], $sExtraDir) !== false)); // Some modules (root, datamodel) have no 'root_dir'
|
||||
if ($bIsExtra) {
|
||||
// Modules in data/production-modules/ are considered as mandatory and always installed
|
||||
$aAvailableModules[$key]['visible'] = false;
|
||||
$bRemoteExtensionsShouldBeMandatory = !$oWizard->GetParameter('force-uninstall', false);
|
||||
if ($bRemoteExtensionsShouldBeMandatory) {
|
||||
foreach ($aAvailableModules as $key => $aModule) {
|
||||
$bIsExtra = (array_key_exists('root_dir', $aModule) && (strpos($aModule['root_dir'], $sExtraDir) !== false)); // Some modules (root, datamodel) have no 'root_dir'
|
||||
if ($bIsExtra) {
|
||||
// Modules in data/production-modules/ are considered as mandatory and always installed
|
||||
$aAvailableModules[$key]['visible'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ class InstallationFileService
|
||||
continue;
|
||||
}
|
||||
if ($this->CanChooseUnpackageExtension($oExtension)) {
|
||||
if (($oExtension->bVisible) && (count($oExtension->aMissingDependencies) === 0)) {
|
||||
if ($oExtension->bVisible && !$oExtension->HasDependencyIssue()) {
|
||||
$aCurrentModules = [];
|
||||
$aUnselectableModules = [];
|
||||
$bIsExtensionSelectable = true;
|
||||
|
||||
@@ -112,6 +112,22 @@ JS);
|
||||
return;
|
||||
}
|
||||
|
||||
// When the setup reach this step, it already checked whether extensions were uninstallable (during WizStepModulesChoice or combodo-data-feature-removal). We only need to log what has been done.
|
||||
if ($this->oWizard->GetParameter('force-uninstall', false)) {
|
||||
SetupLog::Warning("User disabled uninstallation checks");
|
||||
}
|
||||
$aExtensionsRemoved = json_decode($this->oWizard->GetParameter('removed_extensions'), true) ?? [];
|
||||
$aExtensionsNotUninstallable = json_decode($this->oWizard->GetParameter('extensions_not_uninstallable'), true) ?? [];
|
||||
$aExtensionsForceUninstalled = [];
|
||||
foreach ($aExtensionsRemoved as $sExtensionCode => $sLabel) {
|
||||
if (in_array($sExtensionCode, $aExtensionsNotUninstallable)) {
|
||||
$aExtensionsForceUninstalled[] = $sExtensionCode;
|
||||
}
|
||||
}
|
||||
if (count($aExtensionsForceUninstalled)) {
|
||||
SetupLog::Warning("Extensions uninstalled forcefully : ".implode(',', $aExtensionsForceUninstalled));
|
||||
}
|
||||
|
||||
$oPage->add_ready_script(<<<JS
|
||||
$("#wiz_form").data("installation_status", "not started");
|
||||
ExecuteStep("");
|
||||
|
||||
@@ -31,8 +31,8 @@ class WizStepLandingBeforeAudit extends WizStepModulesChoice
|
||||
$oWizard->SetParameter('db_tls_enabled', $this->oConfig->Get('db_tls.enabled'));
|
||||
$oWizard->SetParameter('db_tls_ca', $this->oConfig->Get('db_tls.ca') ?? '');
|
||||
$oWizard->SetParameter('display_choices', '');
|
||||
$oWizard->SetParameter('extensions_not_uninstallable', '[]');
|
||||
|
||||
$oWizard->SaveParameter('extensions_not_uninstallable', '[]');
|
||||
$oWizard->SaveParameter('use_symbolic_links', MFCompiler::UseSymbolicLinks());
|
||||
$oWizard->SaveParameter('force-uninstall', false);
|
||||
$oWizard->SaveParameter('skip_wizard', false);
|
||||
|
||||
@@ -587,7 +587,7 @@ EOF
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((isset($aChoice['mandatory']) && $aChoice['mandatory']) ||
|
||||
if ((isset($aChoice['mandatory']) && $aChoice['mandatory'] && (!isset($aChoice['dependency_issue']) || !$aChoice['dependency_issue'])) ||
|
||||
(isset($aSelectedChoices[$sChoiceId]) && ($aSelectedChoices[$sChoiceId] == $sChoiceId))) {
|
||||
$sDisplayChoices .= '<li>'.$aChoice['title'].'</li>';
|
||||
if (isset($aChoice['modules'])) {
|
||||
@@ -637,7 +637,7 @@ EOF
|
||||
if ($sChoiceName == null) {
|
||||
$sChoiceName = $sChoiceId;
|
||||
}
|
||||
if ((isset($aChoice['mandatory']) && $aChoice['mandatory']) ||
|
||||
if ((isset($aChoice['mandatory']) && $aChoice['mandatory'] && (!isset($aChoice['dependency_issue']) || !$aChoice['dependency_issue'])) ||
|
||||
(isset($aSelectedChoices[$sChoiceName]) && ($aSelectedChoices[$sChoiceName] == $sChoiceId))) {
|
||||
$sDisplayChoices .= '<li>'.$aChoice['title'].'</li>';
|
||||
if ($aSelectedExtensions !== null) {
|
||||
@@ -751,12 +751,16 @@ EOF
|
||||
$bMissingFromDisk = isset($aChoice['missing']) && $aChoice['missing'] === true;
|
||||
$bMandatory = (isset($aChoice['mandatory']) && $aChoice['mandatory']);
|
||||
$bInstalled = $bMissingFromDisk || $oITopExtension->bInstalled;
|
||||
$bDependencyIssue = $oITopExtension->HasDependencyIssue();
|
||||
|
||||
$bChecked = $bSelected;
|
||||
$bDisabled = false;
|
||||
if ($bMissingFromDisk) {
|
||||
$bDisabled = true;
|
||||
$bChecked = false;
|
||||
} elseif ($bDependencyIssue) {
|
||||
$bDisabled = true;
|
||||
$bChecked = false;
|
||||
} elseif ($bMandatory) {
|
||||
$bDisabled = true;
|
||||
$bChecked = true;
|
||||
@@ -787,6 +791,8 @@ EOF
|
||||
|
||||
return [
|
||||
'uninstallable' => $bCanBeUninstalled,
|
||||
'dependency_issue' => $bDependencyIssue,
|
||||
'mandatory' => $bMandatory,
|
||||
'missing' => $bMissingFromDisk,
|
||||
'installed' => $bInstalled,
|
||||
'disabled' => $bDisabled,
|
||||
@@ -805,7 +811,7 @@ EOF
|
||||
$sChoiceId = $sParentId.self::$SEP.$index;
|
||||
$aFlags = $this->ComputeChoiceFlags($aChoice, $sChoiceId, $aSelectedComponents, $bAllDisabled, $bDisableUninstallCheck, $this->bUpgrade);
|
||||
|
||||
if ($aFlags['disabled'] && !$aFlags['checked'] && !$aFlags['uninstallable'] && !$bDisableUninstallCheck) {
|
||||
if ($aFlags['disabled'] && !$aFlags['checked'] && !$bDisableUninstallCheck && (!$aFlags['uninstallable'] || $aFlags['mandatory'])) {
|
||||
$this->bCanMoveForward = false;//Disable "Next"
|
||||
}
|
||||
|
||||
@@ -882,6 +888,9 @@ EOF
|
||||
if (!$aFlags['uninstallable']) {
|
||||
$sTooltip .= '<div id="badge--'.$sId.'--not-uninstallable" class="ibo-badge ibo-block ibo-is-yellow" title="Once this extension has been installed, it should not be uninstalled." >cannot be uninstalled</div>';
|
||||
}
|
||||
if ($aFlags['dependency_issue']) {
|
||||
$sTooltip .= '<div id="badge--'.$sId.'--cannot-be-installed" class="ibo-badge ibo-block ibo-is-orange" title="This extension cannot be installed because one or more dependencies are not satisfied." >cannot be installed</div>';
|
||||
}
|
||||
|
||||
$sMetadata = '';
|
||||
if (isset($aChoice['version']) && isset($aChoice['source_label'])) {
|
||||
@@ -939,10 +948,6 @@ EOF
|
||||
|
||||
public function GetNextButtonLabel()
|
||||
{
|
||||
if (!$this->bCanMoveForward) {
|
||||
return 'Non-uninstallable extension missing';
|
||||
}
|
||||
|
||||
if ($this->GetStepInfo(1 + $this->GetStepIndex()) === null) {
|
||||
return 'Check compatibility';
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class WizStepSummary extends AbstractWizStepInstall
|
||||
$oPage->add('<div class="closed"><a class="title ibo-setup-summary-title" href="#" aria-label="Extensions to be uninstalled">Extensions to be uninstalled</a>');
|
||||
|
||||
$aExtensionsRemoved = json_decode($this->oWizard->GetParameter('removed_extensions'), true) ?? [];
|
||||
$aExtensionsNotUninstallable = json_decode($this->oWizard->GetParameter('extensions_not_uninstallable')) ?? [];
|
||||
$aExtensionsNotUninstallable = json_decode($this->oWizard->GetParameter('extensions_not_uninstallable'), true) ?? [];
|
||||
if (count($aExtensionsRemoved) > 0) {
|
||||
$sExtensionsRemoved = '<ul>';
|
||||
foreach ($aExtensionsRemoved as $sExtensionCode => $sLabel) {
|
||||
|
||||
@@ -26,11 +26,11 @@ class ExtensionDetailsUIBlockFactory extends AbstractUIBlockFactory
|
||||
$aBadges = [];
|
||||
$bUninstallable = $aExtraFlags['uninstallable'] ?? true;
|
||||
$bMissingFromDisk = $aExtraFlags['missing'] ?? false;
|
||||
$bCannotBeInstalled = $aExtraFlags['cannot-be-installed'] ?? false;
|
||||
$bDependencyIssue = $aExtraFlags['dependency_issue'] ?? false;
|
||||
$bSelected = $aExtraFlags['selected'] ?? true;
|
||||
$bDisabled = $aExtraFlags['disabled'] ?? false;
|
||||
$bRemote = $aExtraFlags['remote'] ?? false;
|
||||
self::AddExtraBadges($aBadges, $bUninstallable, $bMissingFromDisk, $bCannotBeInstalled, $sCode);
|
||||
self::AddExtraBadges($aBadges, $bUninstallable, $bMissingFromDisk, $bDependencyIssue, $sCode);
|
||||
$oBadgeInstalled = BadgeUIBlockFactory::MakeGreen(
|
||||
Dict::S('UI:Layout:ExtensionsDetails:BadgeInstalled'),
|
||||
Dict::S('UI:Layout:ExtensionsDetails:BadgeInstalled+'),
|
||||
@@ -48,7 +48,7 @@ class ExtensionDetailsUIBlockFactory extends AbstractUIBlockFactory
|
||||
|
||||
$oExtensionDetails = new ExtensionDetails($sCode, $sLabel, $sDescription, $aMetaData, $aBadges, $sAbout);
|
||||
$oExtensionDetails->GetToggler()->SetIsToggled(true);
|
||||
if ($bMissingFromDisk || $bCannotBeInstalled) {
|
||||
if ($bMissingFromDisk || $bDependencyIssue) {
|
||||
$oExtensionDetails->GetToggler()->SetIsToggled(false);
|
||||
$oExtensionDetails->GetToggler()->SetIsDisabled(true);
|
||||
} elseif ((!$bUninstallable || $bRemote) && !$bDisabled) {
|
||||
@@ -71,10 +71,10 @@ class ExtensionDetailsUIBlockFactory extends AbstractUIBlockFactory
|
||||
{
|
||||
$aBadges = [];
|
||||
$bUninstallable = $aExtraFlags['uninstallable'] ?? true;
|
||||
$bCannotBeInstalled = $aExtraFlags['cannot-be-installed'] ?? false;
|
||||
$bDependencyIssue = $aExtraFlags['dependency_issue'] ?? false;
|
||||
$bSelected = $aExtraFlags['selected'] ?? false;
|
||||
$bDisabled = $aExtraFlags['disabled'] ?? false;
|
||||
self::AddExtraBadges($aBadges, $bUninstallable, false, $bCannotBeInstalled, $sCode);
|
||||
self::AddExtraBadges($aBadges, $bUninstallable, false, $bDependencyIssue, $sCode);
|
||||
$oBadgeInstalled = BadgeUIBlockFactory::MakeGrey(
|
||||
Dict::S('UI:Layout:ExtensionsDetails:BadgeNotInstalled'),
|
||||
Dict::S('UI:Layout:ExtensionsDetails:BadgeNotInstalled+'),
|
||||
@@ -91,7 +91,7 @@ class ExtensionDetailsUIBlockFactory extends AbstractUIBlockFactory
|
||||
$aBadges[] = $oBadgeToBeUninstalled;
|
||||
$oExtensionDetails = new ExtensionDetails($sCode, $sLabel, $sDescription, $aMetaData, $aBadges, $sAbout);
|
||||
|
||||
if ($bCannotBeInstalled) {
|
||||
if ($bDependencyIssue) {
|
||||
$oExtensionDetails->GetToggler()->SetIsToggled(false);
|
||||
$oExtensionDetails->GetToggler()->SetIsDisabled(true);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class ExtensionDetailsUIBlockFactory extends AbstractUIBlockFactory
|
||||
return $oExtensionDetails;
|
||||
}
|
||||
|
||||
private static function AddExtraBadges(array &$aBadges, bool $bUninstallable, bool $bMissingFromDisk, bool $bCannotBeInstalled, string $sCode)
|
||||
private static function AddExtraBadges(array &$aBadges, bool $bUninstallable, bool $bMissingFromDisk, bool $bDependencyIssue, string $sCode)
|
||||
{
|
||||
if (!$bUninstallable) {
|
||||
$aBadges[] = BadgeUIBlockFactory::MakeYellow(
|
||||
@@ -123,7 +123,7 @@ class ExtensionDetailsUIBlockFactory extends AbstractUIBlockFactory
|
||||
self::GetBadgeId($sCode, self::BADGE_ID_MISSING_FROM_DISK)
|
||||
);
|
||||
}
|
||||
if ($bCannotBeInstalled) {
|
||||
if ($bDependencyIssue) {
|
||||
$aBadges[] = BadgeUIBlockFactory::MakeOrange(
|
||||
Dict::S('UI:Layout:ExtensionsDetails:BadgeCannotBeInstalled'),
|
||||
Dict::S('UI:Layout:ExtensionsDetails:BadgeCannotBeInstalled+'),
|
||||
|
||||
@@ -131,6 +131,23 @@ class Session
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unset all session variables, no matter if they were set by iTop or not
|
||||
*
|
||||
* @return void
|
||||
* @since 3.3.0 N°9625
|
||||
*/
|
||||
public static function UnsetAll(): void
|
||||
{
|
||||
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||
self::Start();
|
||||
$_SESSION = [];
|
||||
self::WriteClose();
|
||||
} else {
|
||||
$_SESSION = [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|array $key key to access to the session variable. To access to $_SESSION['a']['b'] $key must be ['a', 'b']
|
||||
* @param $default
|
||||
@@ -183,6 +200,10 @@ class Session
|
||||
|
||||
public static function ListVariables(): array
|
||||
{
|
||||
if (!isset($_SESSION)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_keys($_SESSION);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,23 @@ class SessionTest extends ItopTestCase
|
||||
$this->assertFalse(Session::IsSet(['test1', 'test2', 'test3']));
|
||||
}
|
||||
|
||||
public function testUnsetAll()
|
||||
{
|
||||
Session::Start();
|
||||
Session::Set('test', 'OK');
|
||||
Session::Set(['test1', 'test2', 'test3'], 'OK');
|
||||
Session::Set('another_test', ['foo' => 'bar']);
|
||||
$this->assertTrue(Session::IsSet('test'));
|
||||
$this->assertTrue(Session::IsSet(['test1', 'test2', 'test3']));
|
||||
$this->assertTrue(Session::IsSet('another_test'));
|
||||
|
||||
Session::UnsetAll();
|
||||
$this->assertEmpty($_SESSION);
|
||||
$this->assertFalse(Session::IsSet('test'));
|
||||
$this->assertFalse(Session::IsSet(['test1', 'test2', 'test3']));
|
||||
$this->assertFalse(Session::IsSet('another_test'));
|
||||
}
|
||||
|
||||
public function testRegenerateId()
|
||||
{
|
||||
Session::Start();
|
||||
|
||||
@@ -49,6 +49,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => false,
|
||||
'disabled' => false,
|
||||
'checked' => false,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'A selected but not installed extension should be checked and enabled' => [
|
||||
@@ -70,10 +72,15 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => false,
|
||||
'disabled' => false,
|
||||
'checked' => true,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'A missing extension should be disabled and unchecked' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
'installed' => false,
|
||||
],
|
||||
],
|
||||
'aWizardStepDefinition' => [
|
||||
'extension_code' => 'itop-ext1',
|
||||
@@ -89,10 +96,15 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => true,
|
||||
'checked' => false,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'A missing extension should always be disabled and unchecked, even when mandatory' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
'installed' => false,
|
||||
],
|
||||
],
|
||||
'aWizardStepDefinition' => [
|
||||
'extension_code' => 'itop-ext1',
|
||||
@@ -108,10 +120,15 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => true,
|
||||
'checked' => false,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => true,
|
||||
],
|
||||
],
|
||||
'A missing extension should always be disabled and unchecked, even when non-uninstallable' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
'installed' => false,
|
||||
],
|
||||
],
|
||||
'aWizardStepDefinition' => [
|
||||
'extension_code' => 'itop-ext1',
|
||||
@@ -127,6 +144,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => true,
|
||||
'checked' => false,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => true,
|
||||
],
|
||||
],
|
||||
'An installed but not selected extension should not be checked and be enabled' => [
|
||||
@@ -148,6 +167,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => false,
|
||||
'checked' => false,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'An installed non uninstallable extension should be checked and disabled' => [
|
||||
@@ -169,6 +190,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => true,
|
||||
'checked' => true,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'An installed non uninstallable extension should be enabled if the "disable uninstallation check" flag is set' => [
|
||||
@@ -190,6 +213,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => false,
|
||||
'checked' => true,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'A mandatory extension should be checked and disabled' => [
|
||||
@@ -211,6 +236,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => false,
|
||||
'disabled' => true,
|
||||
'checked' => true,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => true,
|
||||
],
|
||||
],
|
||||
'A mandatory extension should be checked and disabled even if the "disable uninstallation check" flag is set' => [
|
||||
@@ -232,6 +259,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => false,
|
||||
'disabled' => true,
|
||||
'checked' => true,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => true,
|
||||
],
|
||||
],
|
||||
'An optional sub extension should not force its parent flags' => [
|
||||
@@ -265,6 +294,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => false,
|
||||
'disabled' => false,
|
||||
'checked' => false,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'A mandatory sub extension should force its parent to be checked and disabled' => [
|
||||
@@ -298,6 +329,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => false,
|
||||
'disabled' => true,
|
||||
'checked' => true,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'An installed non uninstallable sub extension should force its parent to be checked and disabled' => [
|
||||
@@ -331,6 +364,8 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => true,
|
||||
'checked' => true,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'A non installed non uninstallable sub extension should not force its parent flags' => [
|
||||
@@ -364,6 +399,62 @@ class WizStepModulesChoiceTest extends ItopTestCase
|
||||
'installed' => true,
|
||||
'disabled' => false,
|
||||
'checked' => false,
|
||||
'dependency_issue' => false,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'A non installed extension with missing dependencies should be not checked and disabled' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
'installed' => false,
|
||||
'missing_dependencies' => [
|
||||
'itop-ext1-1',
|
||||
],
|
||||
],
|
||||
],
|
||||
'aWizardStepDefinition' => [
|
||||
'extension_code' => 'itop-ext1',
|
||||
'mandatory' => false,
|
||||
'uninstallable' => true,
|
||||
'missing_dependencies' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
'installed' => false,
|
||||
'disabled' => true,
|
||||
'checked' => false,
|
||||
'dependency_issue' => true,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
'An installed extension with missing dependencies should be not checked and disabled' => [
|
||||
'aExtensionsOnDiskOrDb' => [
|
||||
'itop-ext1' => [
|
||||
'installed' => true,
|
||||
'missing_dependencies' => [
|
||||
'itop-ext1-1',
|
||||
],
|
||||
],
|
||||
],
|
||||
'aWizardStepDefinition' => [
|
||||
'extension_code' => 'itop-ext1',
|
||||
'mandatory' => false,
|
||||
'uninstallable' => true,
|
||||
'missing_dependencies' => true,
|
||||
],
|
||||
'bCurrentSelected' => false,
|
||||
'bDisableUninstallChecks' => false,
|
||||
'aExpectedFlags' => [
|
||||
'uninstallable' => true,
|
||||
'missing' => false,
|
||||
'installed' => true,
|
||||
'disabled' => true,
|
||||
'checked' => false,
|
||||
'dependency_issue' => true,
|
||||
'mandatory' => false,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -23,6 +23,7 @@ class iTopExtensionsMapFake extends iTopExtensionsMap
|
||||
$oExtension->sVersion = $aExtension['version'] ?? '1.0.0';
|
||||
$oExtension->sSource = $aExtension['source'] ?? iTopExtension::SOURCE_MANUAL;
|
||||
$oExtension->aModuleInfo = $aExtension['module_info'] ?? [];
|
||||
$oExtension->aMissingDependencies = $aExtension['missing_dependencies'] ?? [];
|
||||
$oMap->AddExtension($oExtension);
|
||||
}
|
||||
return $oMap;
|
||||
|
||||
Reference in New Issue
Block a user