mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°2847 - Work on the ActivityPanel and PopoverMenu features
- Deprecate cmdbAbstractObject::DisplayBareHistory() as history will be replace by ActivityPanel - Rename illustrations to original filenames to find source more easily - Remove unused "max_history_case_log_entry_length" config. parameter - Activity panel: Introduce iCMDBChangeOp and iCMDBChangeOpSetAttribute interface for better dependency injection - Activity panel: Add placeholder when no entry - Activity panel: Fix tab toolbar icons color - Activity panel: Add history entries (entries after the first 50 are not loaded yet) - Popover menu: Fix no border-radius on first/last entries hover
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2013-2020 Combodo SARL
|
||||
*
|
||||
* This file is part of iTop.
|
||||
*
|
||||
* iTop is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* iTop is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Layout\ActivityPanel\ActivityEntry;
|
||||
|
||||
|
||||
use DateTime;
|
||||
|
||||
/**
|
||||
* Class TransitionEntry
|
||||
*
|
||||
* @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
|
||||
* @package Combodo\iTop\Application\UI\Layout\ActivityPanel\ActivityEntry
|
||||
* @internal
|
||||
* @since 2.8.0
|
||||
*/
|
||||
class TransitionEntry extends ActivityEntry
|
||||
{
|
||||
// Overloaded constants
|
||||
const BLOCK_CODE = 'ibo-transition-entry';
|
||||
const HTML_TEMPLATE_REL_PATH = 'layouts/activity-panel/activity-entry/transition-entry';
|
||||
|
||||
// Specific constants
|
||||
const DEFAULT_DECORATION_CLASSES = 'fas fa-fw fa-map-signs';
|
||||
|
||||
/** @var string $sOriginStateCode Code of the state before the transition */
|
||||
protected $sOriginStateCode;
|
||||
/** @var string $sOriginStateLabel Label of the $sOriginStateCode state */
|
||||
protected $sOriginStateLabel;
|
||||
/** @var string $sTargetStateCode Code of the state after the transition */
|
||||
protected $sTargetStateCode;
|
||||
/** @var string $sTargetStateLabel Label of the $sTargetStateCode state */
|
||||
protected $sTargetStateLabel;
|
||||
|
||||
/**
|
||||
* TransitionEntry constructor.
|
||||
*
|
||||
* @param \DateTime $oDateTime
|
||||
* @param \User $sAuthorLogin
|
||||
* @param string $sObjectClass Class of the object which made the transition
|
||||
* @param string $sOriginStateCode
|
||||
* @param string $sTargetStateCode
|
||||
* @param string $sId
|
||||
*
|
||||
* @throws \CoreException
|
||||
* @throws \OQLException
|
||||
*/
|
||||
public function __construct(DateTime $oDateTime, $sAuthorLogin, $sObjectClass, $sOriginStateCode, $sTargetStateCode, $sId = null)
|
||||
{
|
||||
parent::__construct($oDateTime, $sAuthorLogin, null, $sId);
|
||||
|
||||
$this->SetOriginalState($sObjectClass, $sOriginStateCode);
|
||||
$this->SetTargetState($sObjectClass, $sTargetStateCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the code / label of the state before the transition
|
||||
*
|
||||
* @param string $sObjectClass Class of the object the state is from
|
||||
* @param string $sStateCode
|
||||
*
|
||||
* @return $this
|
||||
* @throws \CoreException
|
||||
*/
|
||||
public function SetOriginalState($sObjectClass, $sStateCode)
|
||||
{
|
||||
$this->sOriginStateCode = $sStateCode;
|
||||
$this->sOriginStateLabel = \MetaModel::GetStateLabel($sObjectClass, $sStateCode);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the code of the state before the transition
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetOriginalStateCode()
|
||||
{
|
||||
return $this->sOriginStateCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the label of the state before the transition
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetOriginalStateLabel()
|
||||
{
|
||||
return $this->sOriginStateLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the code / label of the state after the transition
|
||||
*
|
||||
* @param string $sObjectClas
|
||||
* @param string $sStateCode
|
||||
*
|
||||
* @return $this
|
||||
* @throws \CoreException
|
||||
*/
|
||||
public function SetTargetState($sObjectClas, $sStateCode)
|
||||
{
|
||||
$this->sTargetStateCode = $sStateCode;
|
||||
$this->sTargetStateLabel = \MetaModel::GetStateLabel($sObjectClas, $sStateCode);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the code of the state after the transition
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetTargetStateCode()
|
||||
{
|
||||
return $this->sTargetStateCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the label of the state after the transition
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetTargetStateLabel()
|
||||
{
|
||||
return $this->sTargetStateLabel;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user