mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-16 22:08:44 +02:00
Merge remote-tracking branch 'origin/support/3.2' into develop
This commit is contained in:
@@ -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("<div class='sf_results_area ibo-add-margin-top-250' data-target='search_results'>");
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
@@ -9458,8 +9458,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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 = <<<OQL
|
||||
SELECT `UserRequest` FROM UserRequest AS `UserRequest` WHERE (DATE_FORMAT(`UserRequest`.`ttr_escalation_deadline`, '%Y%v') != DATE_FORMAT(NOW(), '%Y%v'))
|
||||
OQL;
|
||||
|
||||
try{
|
||||
$this->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');
|
||||
|
||||
Reference in New Issue
Block a user