Merge branch 'support/3.0' into saas/3.0

This commit is contained in:
odain
2023-05-22 14:08:02 +02:00
609 changed files with 10493 additions and 7385 deletions

View File

@@ -24,6 +24,7 @@ use AttributeDateTime;
use Combodo\iTop\Application\UI\Base\UIBlock;
use Combodo\iTop\Core\CMDBChange\CMDBChangeOrigin;
use DateTime;
use MetaModel;
use UserRights;
use utils;
@@ -74,6 +75,8 @@ class ActivityEntry extends UIBlock
*/
protected $sOrigin;
protected $bShowAuthorNameBelowEntries;
/**
* ActivityEntry constructor.
*
@@ -94,6 +97,7 @@ class ActivityEntry extends UIBlock
$this->SetDateTime($oDateTime);
$this->SetAuthor($sAuthorLogin);
$this->SetOrigin(static::DEFAULT_ORIGIN);
$this->SetShowAuthorNameBelowEntries(MetaModel::GetConfig()->Get('activity_panel.show_author_name_below_entries'));
}
/**
@@ -306,6 +310,22 @@ class ActivityEntry extends UIBlock
return $this->sOrigin;
}
/**
* @return mixed
*/
public function ShowAuthorNameBelowEntries(): bool
{
return $this->bShowAuthorNameBelowEntries;
}
/**
* @param bool $bShowAuthorNameBelowEntries
*/
public function SetShowAuthorNameBelowEntries($bShowAuthorNameBelowEntries): void
{
$this->bShowAuthorNameBelowEntries = $bShowAuthorNameBelowEntries;
}
/**
* @return string|null The CSS decoration classes for the origin of the entry
* @see \CMDBChangeOrigin

View File

@@ -90,6 +90,17 @@ class ActivityPanel extends UIBlock
protected $oComposeMenu;
/** @var bool Whether a confirmation dialog should be prompt when multiple entries are about to be submitted at once */
protected $bShowMultipleEntriesSubmitConfirmation;
/** @var int */
protected $iDatetimesReformatLimit;
/** @var int */
protected $iLockWatcherPeriod;
/** @var bool */
protected $bPrefilterOnlyCurrentLog;
/** @var bool */
protected $bPrefilterStateChangesOnLogs;
/** @var bool */
protected $bPrefilterEditsOnLogs;
/**
* ActivityPanel constructor.
@@ -105,12 +116,18 @@ class ActivityPanel extends UIBlock
{
parent::__construct($sId);
$oConfig = MetaModel::GetConfig();
$this->InitializeCaseLogTabs();
$this->InitializeCaseLogTabsEntryForms();
$this->InitializeComposeMenu();
$this->SetObjectMode(cmdbAbstractObject::DEFAULT_DISPLAY_MODE);
$this->SetObject($oObject);
$this->SetEntries($aEntries);
$this->SetDatetimesReformatLimit($oConfig->Get('activity_panel.datetimes_reformat_limit'));
$this->SetLockWatcherPeriod($oConfig->Get('activity_panel.lock_watcher_period'));
$this->SetPrefilterOnlyCurrentLog($oConfig->Get('activity_panel.prefilter_only_current_log'));
$this->SetPrefilterStateChangesOnLogs($oConfig->Get('activity_panel.prefilter_state_changes_on_logs'));
$this->SetPrefilterEditsOnLogs($oConfig->Get('activity_panel.prefilter_edits_on_logs'));
$this->bAreEntriesSorted = false;
$this->bHasMoreEntriesToLoad = false;
$this->aLastLoadedEntriesIds = [];
@@ -780,7 +797,7 @@ class ActivityPanel extends UIBlock
}
/**
* @return bool True if the entry form shouldbe opened by default, false otherwise. Based on the user pref. or the config. param. by default.
* @return bool True if the entry form should be opened by default, false otherwise. Based on the user pref. or the config. param. by default.
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
@@ -846,6 +863,86 @@ class ActivityPanel extends UIBlock
return utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php';
}
/**
* @return int
*/
public function GetDatetimesReformatLimit(): int
{
return $this->iDatetimesReformatLimit;
}
/**
* @param int $iDatetimesReformatLimit
*/
public function SetDatetimesReformatLimit(int $iDatetimesReformatLimit): void
{
$this->iDatetimesReformatLimit = $iDatetimesReformatLimit;
}
/**
* @return int
*/
public function GetLockWatcherPeriod(): int
{
return $this->iLockWatcherPeriod;
}
/**
* @param int $iLockWatcherPeriod
*/
public function SetLockWatcherPeriod(int $iLockWatcherPeriod): void
{
$this->iLockWatcherPeriod = $iLockWatcherPeriod;
}
/**
* @return bool
*/
public function GetPrefilterOnlyCurrentLog(): bool
{
return $this->bPrefilterOnlyCurrentLog;
}
/**
* @param bool $bPrefilterOnlyCurrentLog
*/
public function SetPrefilterOnlyCurrentLog(bool $bPrefilterOnlyCurrentLog): void
{
$this->bPrefilterOnlyCurrentLog = $bPrefilterOnlyCurrentLog;
}
/**
* @return bool
*/
public function GetPrefilterStateChangesOnLogs(): bool
{
return $this->bPrefilterStateChangesOnLogs;
}
/**
* @param bool $bPrefilterStateChangesOnLogs
*/
public function SetPrefilterStateChangesOnLogs(bool $bPrefilterStateChangesOnLogs): void
{
$this->bPrefilterStateChangesOnLogs = $bPrefilterStateChangesOnLogs;
}
/**
* @return bool
*/
public function GetPrefilterEditsOnLogs(): bool
{
return $this->bPrefilterEditsOnLogs;
}
/**
* @param bool $bPrefilterEditsOnLogs
*/
public function SetPrefilterEditsOnLogs(bool $bPrefilterEditsOnLogs): void
{
$this->bPrefilterEditsOnLogs = $bPrefilterEditsOnLogs;
}
/**
* @inheritdoc
*/

View File

@@ -5,6 +5,7 @@
*/
namespace Combodo\iTop\Application\UI\Base\Layout\ActivityPanel\CaseLogEntryForm;
use AttributeCaseLog;
use cmdbAbstractObject;
use Combodo\iTop\Application\UI\Base\Component\Input\RichText\RichText;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
@@ -105,6 +106,15 @@ class CaseLogEntryForm extends UIContentBlock
return $this->sAttCode;
}
/**
* @return string
* @since 3.0.4 3.1.0 N°6139
*/
public function GetAttType(): string
{
return AttributeCaseLog::class;
}
/**
* @see static::$sAttCode
* @return string

View File

@@ -15,7 +15,7 @@ use Combodo\iTop\Application\UI\Base\UIBlock;
* Class ColumnUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column
* @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api
*/
@@ -26,6 +26,12 @@ class ColumnUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = Column::class;
/**
* @api
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\Column
*/
public static function MakeStandard(?string $sId = null)
{
$oInput = new Column($sId);
@@ -33,6 +39,13 @@ class ColumnUIBlockFactory extends AbstractUIBlockFactory
return $oInput;
}
/**
* @api
* @param \Combodo\iTop\Application\UI\Base\UIBlock $oBlock
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Layout\MultiColumn\Column\Column
*/
public static function MakeForBlock(UIBlock $oBlock, ?string $sId = null)
{
$oInput = new Column($sId);

View File

@@ -13,7 +13,7 @@ use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
* Class MultiColumnUIBlockFactory
*
* @author Eric Espie <eric.espie@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout\MultiColumn
* @package UIBlockExtensibilityAPI
* @since 3.0.0
* @api
*/
@@ -24,6 +24,12 @@ class MultiColumnUIBlockFactory extends AbstractUIBlockFactory
/** @inheritDoc */
public const UI_BLOCK_CLASS_NAME = MultiColumn::class;
/**
* @api
* @param string|null $sId
*
* @return \Combodo\iTop\Application\UI\Base\Layout\MultiColumn\MultiColumn
*/
public static function MakeStandard(?string $sId = null)
{
$oInput = new MultiColumn($sId);

View File

@@ -86,6 +86,9 @@ class NavigationMenu extends UIBlock implements iKeyboardShortcut
protected $bIsExpanded;
/** @var bool Whether the hint on how the menu filter works shoudl be displayed or not */
protected $bShowMenuFilterHint;
/** @var bool */
protected $bShowMenusCount;
/**
* NavigationMenu constructor.
@@ -106,10 +109,13 @@ class NavigationMenu extends UIBlock implements iKeyboardShortcut
) {
parent::__construct($sId);
$oConfig = MetaModel::GetConfig();
$this->sAppRevisionNumber = utils::GetAppRevisionNumber();
$this->sAppSquareIconUrl = Branding::GetCompactMainLogoAbsoluteUrl();
$this->sAppFullIconUrl = Branding::GetFullMainLogoAbsoluteUrl();
$this->sAppIconLink = MetaModel::GetConfig()->Get('app_icon_url');
$this->sAppIconLink = $oConfig->Get('app_icon_url');
$this->SetShowMenusCount($oConfig->Get('navigation_menu.show_menus_count'));
$this->aSiloSelection = array();
$this->aMenuGroups = ApplicationMenu::GetMenuGroups($oAppContext->GetAsHash());
$this->oUserMenu = $oUserMenu;
@@ -491,4 +497,21 @@ JS;
{
return "[data-role='".static::BLOCK_CODE."']";
}
/**
* @return bool
*/
public function GetShowMenusCount(): bool
{
return $this->bShowMenusCount;
}
/**
* @param bool $bShowMenusCount
*/
public function SetShowMenusCount(bool $bShowMenusCount): void
{
$this->bShowMenusCount = $bShowMenusCount;
}
}

View File

@@ -15,7 +15,8 @@ use Combodo\iTop\Application\UI\Base\Component\Html\Html;
* Class UIContentBlockUIBlockFactory
*
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
* @package Combodo\iTop\Application\UI\Base\Layout
* @package UIBlockExtensibilityAPI
* @api
* @since 3.0.0
*/
class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
@@ -28,6 +29,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
/**
* Make an empty UIContentBlock which can be used to embed anything or to surround another block with specific CSS classes.
*
* @api
* @param string|null $sId
* @param array $aContainerClasses
*
@@ -42,6 +44,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
* Used to display a block of code like <pre> but allows line break.
* The \n are replaced by <br>
*
* @api
* @param string $sCode
* @param string|null $sId
*
@@ -59,6 +62,7 @@ class UIContentBlockUIBlockFactory extends AbstractUIBlockFactory
/**
* Used to display a block of preformatted text in a <pre> tag.
*
* @api
* @param string $sCode
* @param string|null $sId
*