mirror of
https://github.com/Combodo/iTop.git
synced 2026-09-30 05:19:09 +02:00
Compare commits
6 Commits
feature/10
...
3.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e1bf80b9f | ||
|
|
2ac4229ee0 | ||
|
|
e6d485855e | ||
|
|
ab9d270b62 | ||
|
|
4a6af15237 | ||
|
|
05e585ced3 |
1
.github/ISSUE_TEMPLATE/enhancement.yml
vendored
1
.github/ISSUE_TEMPLATE/enhancement.yml
vendored
@@ -9,6 +9,7 @@ body:
|
||||
- Please describe what's your improvement proposition.
|
||||
- Then tell us if you're willing to create a PR for this enhancement ? If so, we'll indicate in the issue if we're interested in it.
|
||||
- The more users are affected and the greater is the impact, the more likely this improvement will be accepted. If you identified a bug and have an improvement proposition, please use the 'Bug report' template instead."
|
||||
Please note we're not willing to accept code improvement (e.g. refactoring) that won't have a "functional" change for the user.
|
||||
|
||||
- type: textarea
|
||||
id: enhancement_details
|
||||
|
||||
5
.github/pull_request_template.md
vendored
5
.github/pull_request_template.md
vendored
@@ -2,8 +2,11 @@
|
||||
IMPORTANT: Before creating your PR, please create an issue first to know if Combodo is interested in your contribution (not needed for translations PR).
|
||||
Since we may refuse a PR, it's preferable to create an issue first, to avoid spending time coding something that won't be accepted.
|
||||
PR that will benefit the most users and has a greater impact on the product are more likely to be accepted, so please explain your use case and why you think it would be useful for the community.
|
||||
We're not willing to receive PR concerning codes improvements (e.g. code refactoring), except if it's part of a code that brings/corrects a feature for users.
|
||||
Please note that we're working with sprints, so we reserve the right to decline a PR if we do not plan to work on that subject in the 6 coming months.
|
||||
Thank you for your comprehension 😊
|
||||
|
||||
Once you've done it, and we confirmed we're interested in it, please follow the guidelines within this PR template before submitting it, it will greatly help us process your PR. 🙏
|
||||
Once you've created the issue, and we confirmed we're interested in it, please follow the guidelines within this PR template before submitting it, it will greatly help us process your PR. 🙏
|
||||
|
||||
Any PRs not following the guidelines or with missing information will not be considered.
|
||||
-->
|
||||
|
||||
@@ -61,7 +61,7 @@ foreach ($aTcpdfFontsDirContent as $sTcpdfFontResourceName) {
|
||||
* 2) Then adding the DroidSansFallback font (useful for CJK data for example)
|
||||
*/
|
||||
echo $sCurrentScriptFileName.": ---2) Copying font files to TCPDF ($sTcPdfFontsFolder)...\n";
|
||||
$aFontFilesToCopy = glob(__DIR__.'\droidsansfallback.*');
|
||||
$aFontFilesToCopy = glob(__DIR__.DIRECTORY_SEPARATOR.'droidsansfallback.*');
|
||||
foreach ($aFontFilesToCopy as $sFontFileToCopy) {
|
||||
$sFontFileName = basename($sFontFileToCopy);
|
||||
echo $sCurrentScriptFileName.': copying '.$sFontFileName."\n";
|
||||
|
||||
@@ -187,11 +187,6 @@ class LoginWebPage extends NiceWebPage
|
||||
}
|
||||
}
|
||||
|
||||
$sReferer = $_SERVER['HTTP_REFERER'] ?? null;
|
||||
if (!is_null($sReferer)) {
|
||||
$aPreviousPostedVars['HTTP_REFERER'] = $sReferer;
|
||||
}
|
||||
|
||||
$aVars = [
|
||||
'bFailedLogin' => $bFailedLogin,
|
||||
'sMessage' => $sMessage,
|
||||
|
||||
19
js/pages/backoffice/dialog.js
Normal file
19
js/pages/backoffice/dialog.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
// Overload of the default dialog widget
|
||||
$.widget('ui.dialog', $.ui.dialog, {
|
||||
_allowInteraction: function (oEvent) {
|
||||
const oTarget = $(oEvent.target);
|
||||
// If we interact with a CKEditor instance in fullscreen mode, we need to allow it
|
||||
// We could check if the current instance is in the dialog, but it's easier to always allow it in fullscreen
|
||||
if (oTarget.closest('.ck.ck-fullscreen__main-wrapper, .ck-body-wrapper').length > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If that's not a specific case, fall back to the default behavior
|
||||
return this._super(oEvent);
|
||||
}
|
||||
});
|
||||
BIN
lib/tecnickcom/tcpdf/fonts/droidsansfallback.ctg.z
Normal file
BIN
lib/tecnickcom/tcpdf/fonts/droidsansfallback.ctg.z
Normal file
Binary file not shown.
2975
lib/tecnickcom/tcpdf/fonts/droidsansfallback.php
Normal file
2975
lib/tecnickcom/tcpdf/fonts/droidsansfallback.php
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lib/tecnickcom/tcpdf/fonts/droidsansfallback.z
Normal file
BIN
lib/tecnickcom/tcpdf/fonts/droidsansfallback.z
Normal file
Binary file not shown.
@@ -1670,20 +1670,7 @@ JS
|
||||
$oExtensionsMap = iTopExtensionsMap::GetExtensionsMap($oWizard->GetParameter('target_env', ITOP_DEFAULT_ENV));
|
||||
$oExtensionsMap->DeclareExtensionAsRemoved($aRemovedExtensionCodes);
|
||||
|
||||
$aAvailableModules = $oProductionEnv->AnalyzeInstallation($oConfig, $aDirsToScan, $bAbortOnMissingDependency, $aModulesToLoad);
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $aAvailableModules;
|
||||
return $oProductionEnv->AnalyzeInstallation($oConfig, $aDirsToScan, $bAbortOnMissingDependency, $aModulesToLoad);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -209,6 +209,7 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage
|
||||
$this->LinkScriptFromAppRoot('js/pages/backoffice/keyboard-shortcuts.js');
|
||||
|
||||
// Used throughout the app.
|
||||
$this->LinkScriptFromAppRoot('js/pages/backoffice/dialog.js');
|
||||
$this->LinkScriptFromAppRoot('js/pages/backoffice/toolbox.js');
|
||||
$this->LinkScriptFromAppRoot('js/pages/backoffice/on-ready.js');
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2026 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Test\UnitTest\DotMake\Dependencies\Composer\Tcpdf;
|
||||
|
||||
use Combodo\iTop\Test\UnitTest\ItopTestCase;
|
||||
|
||||
/**
|
||||
* @coversNothing
|
||||
*/
|
||||
class TcpdfUpdateFontsTest extends ItopTestCase
|
||||
{
|
||||
public function testThatDroidSansFallbackFilesAreCopiedToTcpdfFontsFolderAfterLibraryUpdate(): void
|
||||
{
|
||||
$sSourcePattern = APPROOT
|
||||
.'.make'.DIRECTORY_SEPARATOR.'dependencies'.DIRECTORY_SEPARATOR.'composer'.DIRECTORY_SEPARATOR.'tcpdf'.DIRECTORY_SEPARATOR.'droidsansfallback.*';
|
||||
$aSourceFiles = glob($sSourcePattern);
|
||||
$this->assertIsArray($aSourceFiles, 'Unable to read source TCPDF custom font files.');
|
||||
$this->assertNotEmpty($aSourceFiles, 'No source files found for pattern droidsansfallback.*');
|
||||
|
||||
foreach ($aSourceFiles as $sSourceFilePath) {
|
||||
$sFontFileName = basename($sSourceFilePath);
|
||||
$sDestinationFilePath = APPROOT
|
||||
.'lib'.DIRECTORY_SEPARATOR.'tecnickcom'.DIRECTORY_SEPARATOR.'tcpdf'.DIRECTORY_SEPARATOR.'fonts'.DIRECTORY_SEPARATOR.$sFontFileName;
|
||||
|
||||
$this->assertFileExists($sDestinationFilePath, "Missing copied font file: {$sFontFileName}");
|
||||
$this->assertSame(
|
||||
hash_file('sha256', $sSourceFilePath),
|
||||
hash_file('sha256', $sDestinationFilePath),
|
||||
"Copied font file content mismatch: {$sFontFileName}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,13 @@
|
||||
|
||||
namespace Combodo\iTop\Test\UnitTest\Setup;
|
||||
|
||||
use AnalyzeInstallation;
|
||||
use CheckResult;
|
||||
use Combodo\iTop\Setup\FeatureRemoval\ModelReflectionSerializer;
|
||||
use Combodo\iTop\Test\UnitTest\ItopTestCase;
|
||||
use Config;
|
||||
use ModuleDiscovery;
|
||||
use WizardController;
|
||||
use SetupUtils;
|
||||
|
||||
/**
|
||||
@@ -28,6 +32,13 @@ class SetupUtilsTest extends ItopTestCase
|
||||
|
||||
$this->RequireOnceItopFile('setup/setuputils.class.inc.php');
|
||||
$this->RequireOnceItopFile('setup/setuppage.class.inc.php');
|
||||
$this->RequireOnceItopFile('setup/wizardcontroller.class.inc.php');
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
ModuleDiscovery::ResetCache();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,6 +230,30 @@ OUTPUT;
|
||||
$this->ValidateCheckResults($expected, $aRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bug N°10045
|
||||
*/
|
||||
public function testAnalyzeInstallationDoesNotAutomaticallySetModulesInProductionModulesVisibilityToFalse()
|
||||
{
|
||||
$this->RequireOnceItopFile('setup/moduleinstallation/AnalyzeInstallation.php');
|
||||
$this->SetNonPublicProperty(AnalyzeInstallation::GetInstance(), 'aAvailableModules', null);
|
||||
|
||||
$sRemoteEnv = 'production-temp';
|
||||
$sExtraDir = \utils::GetDataPath().$sRemoteEnv.'-modules/';
|
||||
$sExtraModuleName = 'extra-module';
|
||||
|
||||
$this->createModule($sExtraDir, $sExtraModuleName, '1.0.0');
|
||||
|
||||
$oWizard = new WizardController('WizStepWelcome');
|
||||
$oWizard->SetParameter('source_dir', APPROOT.'datamodels/2.x');
|
||||
$oWizard->SetParameter('remote_env', $sRemoteEnv);
|
||||
|
||||
$aModules = SetupUtils::AnalyzeInstallation($oWizard);
|
||||
|
||||
$this->assertContains($sExtraModuleName, array_keys($aModules), 'Module discovery should have found the extra module');
|
||||
$this->assertTrue($aModules[$sExtraModuleName]['visible'], 'AnalyzeInstallation should not have automatically set the extra module visibility to false');
|
||||
}
|
||||
|
||||
private function ValidateCheckResults(array $expected, array $aActualCheckResults)
|
||||
{
|
||||
$aActual = [];
|
||||
@@ -232,4 +267,37 @@ OUTPUT;
|
||||
self::assertEquals($expected, $aActual);
|
||||
}
|
||||
|
||||
protected function createModule($sDirectory, $sModuleName, $sModuleVersion, $bMandatory = false, $bVisible = true)
|
||||
{
|
||||
$sModuleDir = $sDirectory.'/'.$sModuleName;
|
||||
SetupUtils::builddir($sModuleDir);
|
||||
$this->aFileToClean[] = $sDirectory;
|
||||
|
||||
$sModuleFileName = $sModuleDir.'/module.'.$sModuleName.'.php';
|
||||
|
||||
$sMandatory = var_export($bMandatory, true);
|
||||
$sVisible = var_export($bVisible, true);
|
||||
file_put_contents(
|
||||
$sModuleFileName,
|
||||
<<<PHP
|
||||
<?php
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__,
|
||||
"$sModuleName/$sModuleVersion",
|
||||
[
|
||||
'label' => "$sModuleName",
|
||||
'dependencies' => [],
|
||||
'mandatory' => $sMandatory,
|
||||
'visible' => $sVisible,
|
||||
'datamodel' => [],
|
||||
'data.struct' => [],
|
||||
'data.sample' => [],
|
||||
'doc.manual_setup' => '',
|
||||
'doc.more_information' => '',
|
||||
]
|
||||
);
|
||||
PHP
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user