mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
This tab is an ajax tab (deferred on demand loading) The tab will display the last EventNotification for this action. Number of objects displayed is based on the new `notifications.last_executions_days` config parameter (default to 61 days, can be set to 0 for no limit)
48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
/*
|
|
* @copyright Copyright (C) 2010-2024 Combodo SARL
|
|
* @license http://opensource.org/licenses/AGPL-3.0
|
|
*/
|
|
|
|
namespace Combodo\iTop\Controller\Notifications;
|
|
|
|
use Action;
|
|
use Combodo\iTop\Application\WebPage\AjaxPage;
|
|
use Combodo\iTop\Controller\AbstractController;
|
|
use CoreException;
|
|
use CoreUnexpectedValue;
|
|
use Dict;
|
|
use MetaModel;
|
|
use utils;
|
|
|
|
/**
|
|
* @internal
|
|
* @since 3.2.0 N°5472 creation
|
|
*/
|
|
class ActionController extends AbstractController {
|
|
public const ROUTE_NAMESPACE = 'notifications.action';
|
|
|
|
/**
|
|
* @throws CoreException if cannot load the Action object
|
|
* @throws CoreUnexpectedValue if `actionid` parameter is invalid
|
|
* @since 3.2.0 N°5472 creation
|
|
*/
|
|
public function OperationLastExecutionsTab()
|
|
{
|
|
$sActionId = utils::ReadParam('action_id', null, false);
|
|
$sCannotLoadActionErrorMessage = __METHOD__ . ': invalid action_id parameter';
|
|
if (utils::IsNullOrEmptyString($sActionId)) {
|
|
throw new CoreUnexpectedValue($sCannotLoadActionErrorMessage);
|
|
}
|
|
|
|
$oAction = MetaModel::GetObject(Action::class, $sActionId, false);
|
|
if (is_null($oAction)) {
|
|
throw new CoreException($sCannotLoadActionErrorMessage);
|
|
}
|
|
|
|
$oPage = new AjaxPage(Dict::S('Action:last_executions_tab'));
|
|
$oAction->GetLastExecutionsTabContent($oPage);
|
|
|
|
return $oPage;
|
|
}
|
|
} |