From ce187550f663c62187d50a30a8811218f38a5026 Mon Sep 17 00:00:00 2001 From: odain Date: Thu, 12 Dec 2024 12:21:48 +0100 Subject: [PATCH 1/3] =?UTF-8?q?N=C2=B07750=20-=20Fix=20display=20regressio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/menunode.class.inc.php | 2 +- core/attributedef.class.inc.php | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/application/menunode.class.inc.php b/application/menunode.class.inc.php index 81927e921..32a039e18 100644 --- a/application/menunode.class.inc.php +++ b/application/menunode.class.inc.php @@ -1163,7 +1163,7 @@ class OQLMenuNode extends MenuNode $sIcon = MetaModel::GetClassIcon($sClass, false); if ($bSearchPane) { $aParams = array_merge(['open' => $bSearchOpen, 'table_id' => $sUsageId, 'submit_on_load' => false], $aExtraParams); - $oBlock = new DisplayBlock($oSearch, DisplayBlock::ENUM_STYLE_LIST_SEARCH, false /* Asynchronous */, $aParams); + $oBlock = new DisplayBlock($oSearch, DisplayBlock::ENUM_STYLE_SEARCH, false /* Asynchronous */, $aParams); $oBlock->Display($oPage, 0); $oPage->add("
"); } diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index d94843364..26e3095b2 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1715,8 +1715,8 @@ class AttributeLinkedSet extends AttributeDefinition public function GetEditMode() { return $this->GetOptional('edit_mode', LINKSET_EDITMODE_ACTIONS); - } - + } + /** * @return int see LINKSET_EDITWHEN_* constants * @since 3.1.1 3.2.0 N°6385 @@ -1758,7 +1758,7 @@ class AttributeLinkedSet extends AttributeDefinition { return $this->GetOptional('with_php_computation', false); } - + public function GetLinkedClass() { return $this->Get('linked_class'); @@ -9433,8 +9433,13 @@ class AttributeStopWatch extends AttributeDefinition case 'deadline': if ($value) { - $sDate = date(AttributeDateTime::GetInternalFormat(), $value); - $sRet = AttributeDeadline::FormatDeadline($sDate); + if (is_int($value)) + { + $sDate = date(AttributeDateTime::GetInternalFormat(), $value); + $sRet = AttributeDeadline::FormatDeadline($sDate); + } else { + $sRet = $value; + } } else { From d544ee54984a9b78e5e5e6bbc0f1477e840c6c0c Mon Sep 17 00:00:00 2001 From: odain Date: Fri, 13 Dec 2024 09:35:35 +0100 Subject: [PATCH 2/3] =?UTF-8?q?N=C2=B07750=20-=20ci=20enhance=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitary-tests/application/MenuNodeTest.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php b/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php index 056f163bb..4c9961ece 100644 --- a/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php +++ b/tests/php-unit-tests/unitary-tests/application/MenuNodeTest.php @@ -20,6 +20,17 @@ class MenuNodeTest extends ItopDataTestCase { $this->oUR = $this->CreateUserRequest(666, $aUserRequestCustomParams); } + private function StartStopwatchInThePast(\UserRequest $oTicket, string $sAttCode, int $iSecDelay) + { + $iStartDate = time() - $iSecDelay; + /** @var \ormStopWatch $oStopwatch */ + $oStopwatch = $oTicket->Get($sAttCode); + $oAttDef = \MetaModel::GetAttributeDef(get_class($oTicket), $sAttCode); + $oStopwatch->Start($oTicket, $oAttDef, $iStartDate); + $oStopwatch->ComputeDeadlines($oTicket, $oAttDef); + $oTicket->Set($sAttCode, $oStopwatch); + } + public function RenderOQLSearchProvider() { $aUseCases = []; @@ -59,13 +70,15 @@ OQL; */ public function testRenderOQLSearchOqlWithDateFormatOnDeadline() { + $this->StartStopwatchInThePast($this->oUR, 'ttr', 10); + $sOql = <<CallRenderOQLSearch(true, true, true, $sOql); - $this->assertTrue(true); + $sContent = $this->CallRenderOQLSearch(true, true, true, $sOql); + $this->assertTrue(false !== strpos($sContent, $this->oUR->Get('title')), $sContent); } catch(\Exception $e){ echo($e->getMessage()); $this->fail('Without N°7750 fix Exception raised => TypeError : date(): Argument #2 ($timestamp) must be of type ?int, string given'); From fc388313d773684758d1e7124bf7f6fe0f32fc36 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Fri, 13 Dec 2024 10:14:06 +0100 Subject: [PATCH 3/3] =?UTF-8?q?N=C2=B08050=20-=20Problems=20with=20interfa?= =?UTF-8?q?ce=20discovery=20from=20itop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/Service/InterfaceDiscovery/InterfaceDiscovery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/Service/InterfaceDiscovery/InterfaceDiscovery.php b/sources/Service/InterfaceDiscovery/InterfaceDiscovery.php index 0568af58d..e492c0d08 100644 --- a/sources/Service/InterfaceDiscovery/InterfaceDiscovery.php +++ b/sources/Service/InterfaceDiscovery/InterfaceDiscovery.php @@ -58,7 +58,7 @@ class InterfaceDiscovery */ public function FindItopClasses(string $sInterface): array { - $aExcludedPaths = ['/lib/', '/node_modules/', '/test/', '/tests/']; + $aExcludedPaths = ['/lib/', '/node_modules/', '/test/', '/tests/', '/vendor/']; return $this->FindClasses($sInterface, $aExcludedPaths); }