From f5836b69aff266c0bfe943e44056795891a2d4a1 Mon Sep 17 00:00:00 2001 From: root-nextdom-lxc Date: Sun, 22 Mar 2020 23:12:59 +0100 Subject: [PATCH 1/2] Refactoring and PHPdoc --- core/class/history.class.php | 2 +- src/Controller/Modals/About.php | 1 + src/Controller/Modals/ExpressionTest.php | 1 + src/Controller/Modals/HistoryCalcul.php | 1 + src/Controller/Modals/InteractTest.php | 1 + src/Controller/Modals/LogDisplay.php | 1 + src/Controller/Modals/ObjectConfigure.php | 1 + src/Controller/Modals/ObjectDisplay.php | 1 + src/Controller/Modals/PluginDependency.php | 2 +- src/Controller/Modals/RemoveHistory.php | 1 + src/Controller/Modals/ScenarioExport.php | 1 + src/Controller/Modals/ViewConfigure.php | 1 + .../Pages/AdministrationController.php | 37 +++++++++++-------- src/Controller/Pages/ViewController.php | 1 + src/Controller/Params/CommandeController.php | 1 + src/Controller/Params/EqlogicController.php | 1 + .../Params/InteractConfigController.php | 1 + src/Controller/Params/LinksController.php | 1 + .../Params/ReportConfigController.php | 1 + src/Controller/Params/SummaryController.php | 1 + src/Controller/RebootController.php | 1 + src/Controller/ShutdownController.php | 1 + src/Controller/Tools/DisplayController.php | 18 ++++----- src/Controller/Tools/NoteController.php | 1 + .../Tools/Osdb/DatabaseController.php | 1 + 25 files changed, 53 insertions(+), 27 deletions(-) diff --git a/core/class/history.class.php b/core/class/history.class.php index 68a07c394..74e118012 100644 --- a/core/class/history.class.php +++ b/core/class/history.class.php @@ -106,4 +106,4 @@ public static function getTemporalAvg($_cmd_id, $_startTime, $_endTime){ return HistoryManager::getTemporalAvg($_cmd_id, $_startTime, $_endTime); } -} \ No newline at end of file +} diff --git a/src/Controller/Modals/About.php b/src/Controller/Modals/About.php index 601877ad0..46fc03f92 100644 --- a/src/Controller/Modals/About.php +++ b/src/Controller/Modals/About.php @@ -34,6 +34,7 @@ class About extends BaseAbstractModal * Render about * * @return string + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/ExpressionTest.php b/src/Controller/Modals/ExpressionTest.php index 0d6218d0e..b74f10161 100644 --- a/src/Controller/Modals/ExpressionTest.php +++ b/src/Controller/Modals/ExpressionTest.php @@ -34,6 +34,7 @@ class ExpressionTest extends BaseAbstractModal * Render expression test modal * * @return string + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/HistoryCalcul.php b/src/Controller/Modals/HistoryCalcul.php index 64536e74e..5b1e169d4 100644 --- a/src/Controller/Modals/HistoryCalcul.php +++ b/src/Controller/Modals/HistoryCalcul.php @@ -35,6 +35,7 @@ class HistoryCalcul extends BaseAbstractModal * Render history calcul modal * * @return string + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/InteractTest.php b/src/Controller/Modals/InteractTest.php index 543971e81..0a0563c39 100644 --- a/src/Controller/Modals/InteractTest.php +++ b/src/Controller/Modals/InteractTest.php @@ -34,6 +34,7 @@ class InteractTest extends BaseAbstractModal * Render interact tester modal * * @return string + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/LogDisplay.php b/src/Controller/Modals/LogDisplay.php index 8abdd02ff..8d1c65068 100644 --- a/src/Controller/Modals/LogDisplay.php +++ b/src/Controller/Modals/LogDisplay.php @@ -36,6 +36,7 @@ class LogDisplay extends BaseAbstractModal * Render log display modal * * @return string + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/ObjectConfigure.php b/src/Controller/Modals/ObjectConfigure.php index 2adff0bfc..58db8b8d4 100644 --- a/src/Controller/Modals/ObjectConfigure.php +++ b/src/Controller/Modals/ObjectConfigure.php @@ -39,6 +39,7 @@ class ObjectConfigure extends BaseAbstractModal * @return string * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/ObjectDisplay.php b/src/Controller/Modals/ObjectDisplay.php index 30c101605..d8bbdff76 100644 --- a/src/Controller/Modals/ObjectDisplay.php +++ b/src/Controller/Modals/ObjectDisplay.php @@ -41,6 +41,7 @@ class ObjectDisplay extends BaseAbstractModal * @return string * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/PluginDependency.php b/src/Controller/Modals/PluginDependency.php index 1de3aeb9b..8f640cc89 100644 --- a/src/Controller/Modals/PluginDependency.php +++ b/src/Controller/Modals/PluginDependency.php @@ -36,7 +36,7 @@ class PluginDependency extends BaseAbstractModal * Render plugin daemon modal * * @return string - * @throws \Exception + * @throws \NextDom\Exceptions\CoreException */ public static function get(): string { diff --git a/src/Controller/Modals/RemoveHistory.php b/src/Controller/Modals/RemoveHistory.php index 2f352f12b..3814f69ff 100644 --- a/src/Controller/Modals/RemoveHistory.php +++ b/src/Controller/Modals/RemoveHistory.php @@ -34,6 +34,7 @@ class RemoveHistory extends BaseAbstractModal * Render remove history modal * * @return string + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/ScenarioExport.php b/src/Controller/Modals/ScenarioExport.php index d6d519d6b..2dce9c99f 100644 --- a/src/Controller/Modals/ScenarioExport.php +++ b/src/Controller/Modals/ScenarioExport.php @@ -38,6 +38,7 @@ class ScenarioExport extends BaseAbstractModal * * @return string * @throws CoreException + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Modals/ViewConfigure.php b/src/Controller/Modals/ViewConfigure.php index 91b11d0f8..369e98e84 100644 --- a/src/Controller/Modals/ViewConfigure.php +++ b/src/Controller/Modals/ViewConfigure.php @@ -39,6 +39,7 @@ class ViewConfigure extends BaseAbstractModal * @return string * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public static function get(): string { diff --git a/src/Controller/Pages/AdministrationController.php b/src/Controller/Pages/AdministrationController.php index 83696d6a7..cb09121e9 100644 --- a/src/Controller/Pages/AdministrationController.php +++ b/src/Controller/Pages/AdministrationController.php @@ -128,14 +128,8 @@ function ($value) { ) ); if ($memData[1] != 0) { - $pageData['memoryLoad'] = round(100 * $memData[2] / $memData[1], 2); - if ($memData[1] < 1024) { - $memTotal = $memData[1] . ' B'; - } elseif ($memData[1] < (1024 * 1024)) { - $memTotal = round($memData[1] / 1024, 0) . ' MB'; - } else { - $memTotal = round($memData[1] / 1024 / 1024, 0) . ' GB'; - } + $pageData['memoryLoad'] = round(100 * $memData[2] / $memData[1], 2); + $memTotal = self::swapData($swapData, $memData); $pageData['totalMemory'] = $memTotal; } else { $pageData['memoryLoad'] = 0; @@ -143,13 +137,7 @@ function ($value) { } if ($swapData[1] != 0) { $pageData['swapLoad'] = round(100 * $swapData[2] / $swapData[1], 2); - if ($swapData[1] < 1024) { - $swapTotal = $swapData[1] . ' B'; - } elseif ($memData[1] < (1024 * 1024)) { - $swapTotal = round($swapData[1] / 1024, 0) . ' MB'; - } else { - $swapTotal = round($swapData[1] / 1024 / 1024, 0) . ' GB'; - } + $swapTotal = self::swapData($swapData, $memData); $pageData['administrationSwapTotal'] = $swapTotal; } else { $pageData['swapLoad'] = 0; @@ -163,7 +151,7 @@ function ($value) { private static function countErrorLog(&$pageData) { $pageData['logCount'] = 0; - $currentLogfile = Utils::init('logfile'); + Utils::init('logfile'); $logFilesList = []; $dir = opendir(NEXTDOM_LOG); while ($file = readdir($dir)) { @@ -181,4 +169,21 @@ private static function countErrorLog(&$pageData) } } } + + /** + * @param array $swapData + * @param array $memData + * @return string + */ + private static function swapData(array $swapData, array $memData): string + { + if ($swapData[1] < 1024) { + $swapTotal = $swapData[1] . ' B'; + } elseif ($memData[1] < (1024 * 1024)) { + $swapTotal = round($swapData[1] / 1024, 0) . ' MB'; + } else { + $swapTotal = round($swapData[1] / 1024 / 1024, 0) . ' GB'; + } + return $swapTotal; + } } diff --git a/src/Controller/Pages/ViewController.php b/src/Controller/Pages/ViewController.php index f926a5552..9d3435e12 100644 --- a/src/Controller/Pages/ViewController.php +++ b/src/Controller/Pages/ViewController.php @@ -47,6 +47,7 @@ class ViewController extends BaseController * * @throws CoreException * @throws \ReflectionException + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Params/CommandeController.php b/src/Controller/Params/CommandeController.php index 7d7b84f44..9b0af20ee 100644 --- a/src/Controller/Params/CommandeController.php +++ b/src/Controller/Params/CommandeController.php @@ -39,6 +39,7 @@ class CommandeController extends BaseController * * @return string Content of commandes page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Params/EqlogicController.php b/src/Controller/Params/EqlogicController.php index e086bdabf..de33964f5 100644 --- a/src/Controller/Params/EqlogicController.php +++ b/src/Controller/Params/EqlogicController.php @@ -36,6 +36,7 @@ class EqlogicController extends BaseController * * @param array $pageData * @return string + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Params/InteractConfigController.php b/src/Controller/Params/InteractConfigController.php index fa66a551e..6f5661929 100644 --- a/src/Controller/Params/InteractConfigController.php +++ b/src/Controller/Params/InteractConfigController.php @@ -39,6 +39,7 @@ class InteractConfigController extends BaseController * * @return string Content of interaction config page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Params/LinksController.php b/src/Controller/Params/LinksController.php index 9bb2724ba..c6f91c6a9 100644 --- a/src/Controller/Params/LinksController.php +++ b/src/Controller/Params/LinksController.php @@ -39,6 +39,7 @@ class LinksController extends BaseController * * @return string Content of links page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Params/ReportConfigController.php b/src/Controller/Params/ReportConfigController.php index 02befbf42..44884ca8d 100644 --- a/src/Controller/Params/ReportConfigController.php +++ b/src/Controller/Params/ReportConfigController.php @@ -39,6 +39,7 @@ class ReportConfigController extends BaseController * * @return string Content of report config page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Params/SummaryController.php b/src/Controller/Params/SummaryController.php index 3ddcdddf4..6242f828b 100644 --- a/src/Controller/Params/SummaryController.php +++ b/src/Controller/Params/SummaryController.php @@ -38,6 +38,7 @@ class SummaryController extends BaseController * * @return string Content of summary page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/RebootController.php b/src/Controller/RebootController.php index 1941f8072..3723e363b 100644 --- a/src/Controller/RebootController.php +++ b/src/Controller/RebootController.php @@ -38,6 +38,7 @@ class RebootController extends BaseController * * @return string Content of reboot page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/ShutdownController.php b/src/Controller/ShutdownController.php index efb4d96bb..834ced9a4 100644 --- a/src/Controller/ShutdownController.php +++ b/src/Controller/ShutdownController.php @@ -37,6 +37,7 @@ class ShutdownController extends BaseController * * @return string Content of shutdown page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Tools/DisplayController.php b/src/Controller/Tools/DisplayController.php index f78418cfb..605d8510b 100644 --- a/src/Controller/Tools/DisplayController.php +++ b/src/Controller/Tools/DisplayController.php @@ -45,11 +45,11 @@ class DisplayController extends BaseController */ public static function get(&$pageData): string { - $nbEqlogics = 0; - $nbCmds = 0; - $jeeObjects = JeeObjectManager::all(); - $eqLogics = []; - $cmds = []; + $nbEqlogics = 0; + $nbCmds = 0; + $jeeObjects = JeeObjectManager::all(); + $eqLogics = []; + $cmds = []; $eqLogics[-1] = EqLogicManager::byObjectId(null, false); foreach ($eqLogics[-1] as $eqLogic) { @@ -67,11 +67,11 @@ public static function get(&$pageData): string $nbEqlogics += count($eqLogics[$jeeObject->getId()]); } - $pageData['displayObjects'] = $jeeObjects; + $pageData['displayObjects'] = $jeeObjects; $pageData['displayNbEqLogics'] = $nbEqlogics; - $pageData['displayNbCmds'] = $nbCmds; - $pageData['displayEqLogics'] = $eqLogics; - $pageData['displayCmds'] = $cmds; + $pageData['displayNbCmds'] = $nbCmds; + $pageData['displayEqLogics'] = $eqLogics; + $pageData['displayCmds'] = $cmds; $pageData[ControllerData::JS_END_POOL][] = '/public/js/desktop/tools/display.js'; diff --git a/src/Controller/Tools/NoteController.php b/src/Controller/Tools/NoteController.php index 4f8120253..18530f93c 100644 --- a/src/Controller/Tools/NoteController.php +++ b/src/Controller/Tools/NoteController.php @@ -39,6 +39,7 @@ class NoteController extends BaseController * * @return string Content of migration page * + * @throws \Exception */ public static function get(&$pageData): string { diff --git a/src/Controller/Tools/Osdb/DatabaseController.php b/src/Controller/Tools/Osdb/DatabaseController.php index 3e622f697..4d52aa9e5 100644 --- a/src/Controller/Tools/Osdb/DatabaseController.php +++ b/src/Controller/Tools/Osdb/DatabaseController.php @@ -39,6 +39,7 @@ class DatabaseController extends BaseController * * @return string Content of database page * + * @throws \Exception */ public static function get(&$pageData): string { From cbe99766bff4729dadcac0f241abd3eef7b49d7a Mon Sep 17 00:00:00 2001 From: Sylvaner Date: Tue, 28 Apr 2020 13:20:13 +0200 Subject: [PATCH 2/2] Fix some sonarcloud issues --- src/Ajax/CmdAjax.php | 45 ++++--- src/Ajax/EqLogicAjax.php | 38 +++--- src/Ajax/InteractAjax.php | 24 ++-- src/Ajax/ListenerAjax.php | 9 +- src/Ajax/ObjectAjax.php | 112 ++++++++---------- src/Ajax/ScenarioAjax.php | 17 +-- src/Ajax/UpdateAjax.php | 18 ++- .../Pages/AdministrationController.php | 1 - src/Enums/AjaxParams.php | 1 + src/Enums/Common.php | 1 + 10 files changed, 129 insertions(+), 137 deletions(-) diff --git a/src/Ajax/CmdAjax.php b/src/Ajax/CmdAjax.php index 19230c3a4..e8dd90b61 100644 --- a/src/Ajax/CmdAjax.php +++ b/src/Ajax/CmdAjax.php @@ -19,6 +19,7 @@ use NextDom\Enums\ActionRight; use NextDom\Enums\AjaxParams; +use NextDom\Enums\CmdConfigKey; use NextDom\Enums\CmdType; use NextDom\Enums\CmdViewType; use NextDom\Enums\Common; @@ -57,7 +58,6 @@ class CmdAjax extends BaseAjax * Get one or more command(s) HTML render * * @throws CoreException - * @throws \ReflectionException */ public function toHtml() { @@ -71,7 +71,7 @@ public function toHtml() } $result[$cmd->getId()] = [ 'html' => $cmd->toHtml($value[Common::VERSION]), - 'id' => $cmd->getId(), + AjaxParams::ID => $cmd->getId(), ]; } $this->ajax->success($result); @@ -79,10 +79,10 @@ public function toHtml() // Render one command $cmd = CmdManager::byId(Utils::init(AjaxParams::ID)); if (!is_object($cmd)) { - throw new CoreException(__('Commande inconnue - Vérifiez l\'id')); + throw new CoreException(__('Commande inconnue - Vérifiez l\'ID')); } $result = []; - $result['id'] = $cmd->getId(); + $result[AjaxParams::ID] = $cmd->getId(); $result['html'] = $cmd->toHtml(Utils::init(AjaxParams::VERSION), Utils::init(AjaxParams::OPTION), Utils::init('cmdColor', null)); $this->ajax->success($result); } @@ -92,7 +92,6 @@ public function toHtml() * Execute a command * * @throws CoreException - * @throws \ReflectionException */ public function execCmd() { @@ -306,7 +305,7 @@ public function save() { AuthentificationHelper::isConnectedAsAdminOrFail(); $cmdAjaxData = NextDomHelper::fromHumanReadable(json_decode(Utils::init(NextDomObj::CMD), true)); - $cmd = CmdManager::byId($cmdAjaxData['id']); + $cmd = CmdManager::byId($cmdAjaxData[AjaxParams::ID]); if (!is_object($cmd)) { $cmd = new Cmd(); } @@ -326,7 +325,7 @@ public function multiSave() AuthentificationHelper::isConnectedAsAdminOrFail(); $cmds = json_decode(Utils::init(NextDomObj::CMD), true); foreach ($cmds as $cmdAjaxData) { - $cmd = CmdManager::byId($cmdAjaxData['id']); + $cmd = CmdManager::byId($cmdAjaxData[AjaxParams::ID]); if (!is_object($cmd)) { continue; } @@ -419,8 +418,8 @@ public function getHistory() if ($dateStart !== '') { $dateStart = Utils::init(AjaxParams::DATE_START, date(DateFormat::FULL_DAY, strtotime(ConfigManager::byKey('history::defautShowPeriod') . ' ' . date(DateFormat::FULL_DAY)))); } - $result['maxValue'] = ''; - $result['minValue'] = ''; + $result[CmdConfigKey::MAX_VALUE] = ''; + $result[CmdConfigKey::MIN_VALUE] = ''; if ($dateStart === null) { $result['dateStart'] = ''; } else { @@ -482,11 +481,11 @@ public function getHistory() } $infoHistory[] = $value; if (!$NEXTDOM_INTERNAL_CONFIG[NextDomObj::CMD][Common::TYPE][Common::INFO][Common::SUBTYPE][$cmd->getSubType()][Common::IS_HISTORIZED][Common::TIMELINE_ONLY]) { - if (($value !== null && $value > $result['maxValue']) || $result['maxValue'] == '') { - $result['maxValue'] = round($value, 1); + if (($value !== null && $value > $result[CmdConfigKey::MAX_VALUE]) || $result[CmdConfigKey::MAX_VALUE] == '') { + $result[CmdConfigKey::MAX_VALUE] = round($value, 1); } - if (($value !== null && $value < $result['minValue']) || $result['minValue'] == '') { - $result['minValue'] = round($value, 1); + if (($value !== null && $value < $result[CmdConfigKey::MIN_VALUE]) || $result[CmdConfigKey::MIN_VALUE] == '') { + $result[CmdConfigKey::MIN_VALUE] = round($value, 1); } } $data[] = $infoHistory; @@ -498,18 +497,18 @@ public function getHistory() $infoHistory = []; $infoHistory[] = floatval($datetime) * 1000; $infoHistory[] = ($value === null) ? null : floatval($value); - if ($value > $result['maxValue'] || $result['maxValue'] == '') { - $result['maxValue'] = round($value, 1); + if ($value > $result[CmdConfigKey::MAX_VALUE] || $result[CmdConfigKey::MAX_VALUE] == '') { + $result[CmdConfigKey::MAX_VALUE] = round($value, 1); } - if ($value < $result['minValue'] || $result['minValue'] == '') { - $result['minValue'] = round($value, 1); + if ($value < $result[CmdConfigKey::MIN_VALUE] || $result[CmdConfigKey::MIN_VALUE] == '') { + $result[CmdConfigKey::MIN_VALUE] = round($value, 1); } $data[] = $infoHistory; } } $result['cmd_name'] = $cmdId; $result['history_name'] = $cmdId; - $result['unite'] = Utils::init('unite'); + $result[Common::UNITE] = Utils::init(Common::UNITE); } $result['data'] = $data; $this->ajax->success($result); @@ -544,10 +543,10 @@ public function setOrder() $cmds = json_decode(Utils::init('cmds'), true); $eqLogics = []; foreach ($cmds as $cmdJsonData) { - if (!isset($cmdJsonData['id']) || trim($cmdJsonData['id']) == '') { + if (!isset($cmdJsonData[AjaxParams::ID]) || trim($cmdJsonData[AjaxParams::ID]) == '') { continue; } - $cmd = CmdManager::byId($cmdJsonData['id']); + $cmd = CmdManager::byId($cmdJsonData[AjaxParams::ID]); if (!is_object($cmd)) { continue; } @@ -555,16 +554,16 @@ public function setOrder() $cmd->setOrder($cmdJsonData['order']); $cmd->save(); } - if (isset($cmdJsonData['line']) && isset($cmdJsonData['column'])) { + if (isset($cmdJsonData['line']) && isset($cmdJsonData[Common::COLUMN])) { $renderVersion = Utils::init(AjaxParams::VERSION, CmdViewType::DASHBOARD); if (!isset($eqLogics[$cmd->getEqLogic_id()])) { $eqLogics[$cmd->getEqLogic_id()] = [NextDomObj::EQLOGIC => $cmd->getEqLogic(), Common::CHANGED => false]; } $layoutDisplay = 'layout::' . $renderVersion . '::table::cmd::' . $cmd->getId(); if ($eqLogics[$cmd->getEqLogic_id()][NextDomObj::EQLOGIC]->getDisplay($layoutDisplay . '::line') != $cmdJsonData['line'] - || $eqLogics[$cmd->getEqLogic_id()][NextDomObj::EQLOGIC]->getDisplay($layoutDisplay . '::column') != $cmdJsonData['column']) { + || $eqLogics[$cmd->getEqLogic_id()][NextDomObj::EQLOGIC]->getDisplay($layoutDisplay . '::column') != $cmdJsonData[Common::COLUMN]) { $eqLogics[$cmd->getEqLogic_id()][NextDomObj::EQLOGIC]->setDisplay($layoutDisplay . '::line', $cmdJsonData['line']); - $eqLogics[$cmd->getEqLogic_id()][NextDomObj::EQLOGIC]->setDisplay($layoutDisplay . '::column', $cmdJsonData['column']); + $eqLogics[$cmd->getEqLogic_id()][NextDomObj::EQLOGIC]->setDisplay($layoutDisplay . '::column', $cmdJsonData[Common::COLUMN]); $eqLogics[$cmd->getEqLogic_id()][Common::CHANGED] = true; } } diff --git a/src/Ajax/EqLogicAjax.php b/src/Ajax/EqLogicAjax.php index 619b226f1..c03fbf0a2 100644 --- a/src/Ajax/EqLogicAjax.php +++ b/src/Ajax/EqLogicAjax.php @@ -26,9 +26,11 @@ use NextDom\Helpers\AuthentificationHelper; use NextDom\Helpers\NextDomHelper; use NextDom\Helpers\Utils; +use NextDom\Managers\CmdManager; use NextDom\Managers\EqLogicManager; use NextDom\Managers\JeeObjectManager; use NextDom\Model\Entity\Cmd; +use NextDom\Model\Entity\EqLogic; /** * Class EqLogicAjax @@ -52,7 +54,7 @@ public function getEqLogicObject() foreach ($linkedObject->getEqLogic() as $eqLogic) { if ($eqLogic->isVisible()) { $info_eqLogic = []; - $info_eqLogic[Common::ID] = $eqLogic->getId(); + $info_eqLogic[AjaxParams::ID] = $eqLogic->getId(); $info_eqLogic[Common::TYPE] = $eqLogic->getEqType_name(); $info_eqLogic[Common::OBJECT_ID] = $eqLogic->getObject_id(); $info_eqLogic[Common::HTML] = $eqLogic->toHtml(Utils::init(AjaxParams::VERSION)); @@ -84,7 +86,7 @@ public function toHtml() throw new CoreException(__('Pas de version indiqué pour le rendu HTML')); } $result[$eqLogic->getId()] = [ - Common::ID => $eqLogic->getId(), + AjaxParams::ID => $eqLogic->getId(), Common::TYPE => $eqLogic->getEqType_name(), Common::OBJECT_ID => $eqLogic->getObject_id(), Common::HTML => $eqLogic->toHtml($eqLogicData[AjaxParams::VERSION]), @@ -97,7 +99,7 @@ public function toHtml() throw new CoreException(__('Eqlogic inconnu. Vérifiez l\'ID')); } $eqLogicInfo = []; - $eqLogicInfo[Common::ID] = $eqLogic->getId(); + $eqLogicInfo[AjaxParams::ID] = $eqLogic->getId(); $eqLogicInfo[Common::TYPE] = $eqLogic->getEqType_name(); $eqLogicInfo[Common::OBJECT_ID] = $eqLogic->getObject_id(); $eqLogicInfo[Common::HTML] = $eqLogic->toHtml(Utils::init(AjaxParams::VERSION)); @@ -114,7 +116,7 @@ public function htmlAlert() } $result[$eqLogic->getId()] = [ Common::HTML => $eqLogic->toHtml(Utils::init(AjaxParams::VERSION)), - Common::ID => $eqLogic->getId(), + AjaxParams::ID => $eqLogic->getId(), Common::TYPE => $eqLogic->getEqType_name(), Common::OBJECT_ID => $eqLogic->getObject_id(), ]; @@ -145,7 +147,7 @@ public function htmlBattery() foreach ($list as $eqLogic) { $result[] = [ Common::HTML => $eqLogic->batteryWidget(Utils::init(AjaxParams::VERSION)), - Common::ID => $eqLogic->getId(), + AjaxParams::ID => $eqLogic->getId(), Common::TYPE => $eqLogic->getEqType_name(), Common::OBJECT_ID => $eqLogic->getObject_id(), ]; @@ -197,7 +199,7 @@ public function listByTypeAndCmdType() $eqLogicList = EqLogicManager::listByTypeAndCmdType(Utils::init(AjaxParams::TYPE), Utils::init(AjaxParams::TYPE_CMD), Utils::init(AjaxParams::SUB_TYPE_CMD)); $result = []; foreach ($eqLogicList as $eqLogic) { - $eqLogic = EqLogicManager::byId($eqLogic[Common::ID]); + $eqLogic = EqLogicManager::byId($eqLogic[AjaxParams::ID]); $info[NextDomObj::EQLOGIC] = Utils::o2a($eqLogic); $info[NextDomObj::OBJECT] = ['name' => 'Aucun']; if (is_object($eqLogic)) { @@ -230,10 +232,10 @@ public function setOrder() { $eqLogics = json_decode(Utils::init('eqLogics'), true); foreach ($eqLogics as $eqLogic_json) { - if (!isset($eqLogic_json[Common::ID]) || trim($eqLogic_json[Common::ID]) == '') { + if (!isset($eqLogic_json[AjaxParams::ID]) || trim($eqLogic_json[AjaxParams::ID]) == '') { continue; } - $eqLogic = EqLogicManager::byId($eqLogic_json[Common::ID]); + $eqLogic = EqLogicManager::byId($eqLogic_json[AjaxParams::ID]); if (!is_object($eqLogic)) { continue; } @@ -297,9 +299,9 @@ public function simpleSave() { AuthentificationHelper::isConnectedAsAdminOrFail(); $eqLogicSave = json_decode(Utils::init(NextDomObj::EQLOGIC), true); - $eqLogic = EqLogicManager::byId($eqLogicSave[Common::ID]); + $eqLogic = EqLogicManager::byId($eqLogicSave[AjaxParams::ID]); if (!is_object($eqLogic)) { - throw new CoreException(__('EqLogic inconnu. Vérifiez l\'ID ') . $eqLogicSave[Common::ID]); + throw new CoreException(__('EqLogic inconnu. Vérifiez l\'ID ') . $eqLogicSave[AjaxParams::ID]); } if (!$eqLogic->hasRight(ActionRight::WRITE)) { @@ -355,7 +357,6 @@ public function get() public function save() { AuthentificationHelper::isConnectedAsAdminOrFail(); - $eqLogicsSave = json_decode(Utils::init(NextDomObj::EQLOGIC), true); foreach ($eqLogicsSave as $eqLogicSave) { @@ -363,14 +364,15 @@ public function save() if (!is_array($eqLogicSave)) { throw new CoreException(__('Informations reçues incorrectes')); } - $typeEqLogic = Utils::init(AjaxParams::TYPE); + $typeEqLogic = Utils::initStr(AjaxParams::TYPE); $typeCmd = $typeEqLogic . NextDomObj::CMD; if ($typeEqLogic == '' || !class_exists($typeEqLogic) || !class_exists($typeCmd)) { throw new CoreException(__('Type incorrect, (classe commande inexistante)') . $typeCmd); } + /** @var EqLogic $eqLogic */ $eqLogic = null; - if (isset($eqLogicSave[Common::ID])) { - $eqLogic = $typeEqLogic::byId($eqLogicSave[Common::ID]); + if (isset($eqLogicSave[AjaxParams::ID])) { + $eqLogic = $typeEqLogic::byId($eqLogicSave[AjaxParams::ID]); } if (!is_object($eqLogic)) { $eqLogic = new $typeEqLogic(); @@ -385,7 +387,7 @@ public function save() } $eqLogicSave = NextDomHelper::fromHumanReadable($eqLogicSave); Utils::a2o($eqLogic, $eqLogicSave); - $dbList = $typeCmd::byEqLogicId($eqLogic->getId()); + $dbList = CmdManager::byEqLogicId($eqLogic->getId()); $eqLogic->save(); $enableList = []; @@ -393,8 +395,8 @@ public function save() $cmd_order = 0; foreach ($eqLogicSave[NextDomObj::CMD] as $cmd_info) { $cmd = null; - if (isset($cmd_info[Common::ID])) { - $cmd = $typeCmd::byId($cmd_info[Common::ID]); + if (isset($cmd_info[AjaxParams::ID])) { + $cmd = CmdManager::byId($cmd_info[AjaxParams::ID]); } if (!is_object($cmd)) { $cmd = new $typeCmd(); @@ -415,6 +417,7 @@ public function save() if (method_exists($eqLogic, 'postAjax')) { $eqLogic->postAjax(); } + $this->ajax->success(Utils::o2a($eqLogic)); } catch (\Exception $e) { if (strpos($e->getMessage(), '[MySQL] Error code : 23000') !== false) { if ($e->getTrace()[2]['class'] == NextDomObj::EQLOGIC) { @@ -426,7 +429,6 @@ public function save() throw new CoreException($e->getMessage()); } } - $this->ajax->success(Utils::o2a($eqLogic)); } $this->ajax->success(null); } diff --git a/src/Ajax/InteractAjax.php b/src/Ajax/InteractAjax.php index 95518869c..7bd230697 100644 --- a/src/Ajax/InteractAjax.php +++ b/src/Ajax/InteractAjax.php @@ -18,6 +18,8 @@ namespace NextDom\Ajax; use NextDom\Enums\AjaxParams; +use NextDom\Enums\Common; +use NextDom\Enums\SQLField; use NextDom\Enums\UserRight; use NextDom\Exceptions\CoreException; use NextDom\Helpers\NextDomHelper; @@ -42,18 +44,18 @@ public function all() $results = Utils::o2a(InteractDefManager::all()); foreach ($results as &$result) { // @TODO TOus sélectionnés dans tous les cas - $result['nbInteractQuery'] = count(InteractQueryManager::byInteractDefId($result['id'])); - $result['nbEnableInteractQuery'] = count(InteractQueryManager::byInteractDefId($result['id'])); - if ($result['link_type'] == 'cmd' && $result['link_id'] != '') { - $link_id = ''; - foreach (explode('&&', $result['link_id']) as $cmd_id) { + $result['nbInteractQuery'] = count(InteractQueryManager::byInteractDefId($result[AjaxParams::ID])); + $result['nbEnableInteractQuery'] = count(InteractQueryManager::byInteractDefId($result[AjaxParams::ID])); + if ($result[SQLField::LINK_TYPE] == 'cmd' && $result[SQLField::LINK_ID] != '') { + $linkId = ''; + foreach (explode('&&', $result[SQLField::LINK_ID]) as $cmd_id) { $cmd = CmdManager::byId($cmd_id); if (is_object($cmd)) { - $link_id .= CmdManager::cmdToHumanReadable('#' . $cmd->getId() . '# && '); + $linkId .= CmdManager::cmdToHumanReadable('#' . $cmd->getId() . '# && '); } } - $result['link_id'] = trim(trim($link_id), '&&'); + $result[SQLField::LINK_ID] = trim(trim($linkId), '&&'); } } $this->ajax->success($results); @@ -62,16 +64,16 @@ public function all() public function byId() { $result = Utils::o2a(InteractDefManager::byId(Utils::init(AjaxParams::ID))); - $result['nbInteractQuery'] = count(InteractQueryManager::byInteractDefId($result['id'])); - $result['nbEnableInteractQuery'] = count(InteractQueryManager::byInteractDefId($result['id'])); + $result['nbInteractQuery'] = count(InteractQueryManager::byInteractDefId($result[AjaxParams::ID])); + $result['nbEnableInteractQuery'] = count(InteractQueryManager::byInteractDefId($result[AjaxParams::ID])); $this->ajax->success(NextDomHelper::toHumanReadable($result)); } public function save() { $interact_json = NextDomHelper::fromHumanReadable(json_decode(Utils::init('interact'), true)); - if (isset($interact_json['id'])) { - $interact = InteractDefManager::byId($interact_json['id']); + if (isset($interact_json[AjaxParams::ID])) { + $interact = InteractDefManager::byId($interact_json[AjaxParams::ID]); } if (!isset($interact) || !is_object($interact)) { $interact = new InteractDef(); diff --git a/src/Ajax/ListenerAjax.php b/src/Ajax/ListenerAjax.php index 5898edcf9..bf0efa1b4 100644 --- a/src/Ajax/ListenerAjax.php +++ b/src/Ajax/ListenerAjax.php @@ -18,6 +18,7 @@ namespace NextDom\Ajax; use NextDom\Enums\AjaxParams; +use NextDom\Enums\Common; use NextDom\Enums\UserRight; use NextDom\Exceptions\CoreException; use NextDom\Helpers\NextDomHelper; @@ -54,11 +55,11 @@ public function all() { $listeners = Utils::o2a(ListenerManager::all()); foreach ($listeners as &$listener) { - $listener['event_str'] = ''; - foreach ($listener['event'] as $event) { - $listener['event_str'] .= $event . ','; + $listener[AjaxParams::EVENT_STR] = ''; + foreach ($listener[Common::EVENT] as $event) { + $listener[AjaxParams::EVENT_STR] .= $event . ','; } - $listener['event_str'] = NextDomHelper::toHumanReadable(trim($listener['event_str'], ',')); + $listener[AjaxParams::EVENT_STR] = NextDomHelper::toHumanReadable(trim($listener[AjaxParams::EVENT_STR], ',')); } $this->ajax->success($listeners); } diff --git a/src/Ajax/ObjectAjax.php b/src/Ajax/ObjectAjax.php index 073f2a8a7..973579058 100644 --- a/src/Ajax/ObjectAjax.php +++ b/src/Ajax/ObjectAjax.php @@ -113,8 +113,8 @@ public function save() { AuthentificationHelper::isConnectedAsAdminOrFail(); $jsonObject = json_decode(Utils::init(AjaxParams::OBJECT), true); - if (isset($jsonObject['id'])) { - $resultObject = JeeObjectManager::byId($jsonObject['id']); + if (isset($jsonObject[AjaxParams::ID])) { + $resultObject = JeeObjectManager::byId($jsonObject[AjaxParams::ID]); } if (!isset($resultObject) || !is_object($resultObject)) { $resultObject = new JeeObject(); @@ -157,80 +157,68 @@ public function toHtml() } else { $objectsList = []; if (Utils::init(AjaxParams::SUMMARY) == '') { - foreach (JeeObjectManager::buildTree(null, true) as $object) { - if ($object->getConfiguration('hideOnDashboard', 0) == 1) { + foreach (JeeObjectManager::buildTree(null, true) as $objectId) { + if ($objectId->getConfiguration('hideOnDashboard', 0) == 1) { continue; } - $objects[] = $object->getId(); + $objects[] = $objectId->getId(); } } else { - foreach (JeeObjectManager::all() as $object) { - $objects[] = $object->getId(); + foreach (JeeObjectManager::all() as $objectId) { + $objects[] = $objectId->getId(); } } } $result = []; $scenariosResult = []; $i = 0; - foreach ($objectsList as $id) { - $html = []; - if (Utils::init(AjaxParams::SUMMARY) == '') { - $eqLogics = EqLogicManager::byObjectId($id, true, true); - } else { - $resultObject = JeeObjectManager::byId($id); - $eqLogics = $resultObject->getEqLogicBySummary(Utils::init(AjaxParams::SUMMARY), true, false); - } - $this->toHtmlEqLogics($html, $eqLogics); - $scenarios = ScenarioManager::byObjectId($id, false, true); - if (count($scenarios) > 0) { - $scenariosResult[$i . '::' . $id] = []; - /** - * @var Scenario $scenario - */ - foreach ($scenarios as $scenario) { - $scenariosResult[$i . '::' . $id][] = [ - 'scenario_id' => $scenario->getId(), - 'state' => $scenario->getState(), - 'name' => $scenario->getName(), - 'icon' => $scenario->getDisplay(Common::ICON), - 'active' => $scenario->getIsActive() - ]; - } - } - ksort($html); - $result[$i . '::' . $id] = implode($html); + foreach ($objectsList as $objectId) { + $objectId = intval($objectId); + $htmlObject = $this->renderObjectAsHtml($objectId); + $scenariosResult = array_merge($scenariosResult, $this->renderScenariosAsHtml($objectId)); + $result[$i . '::' . $objectId] = implode($htmlObject); $i++; } $this->ajax->success([Common::OBJECT_HTML => $result, NextDomObj::SCENARIOS => $scenariosResult]); } else { $objectId = intval($objectId); - $html = []; - if (Utils::init(AjaxParams::SUMMARY) == '') { - $eqLogics = EqLogicManager::byObjectId($objectId, true, true); - } else { - $resultObject = JeeObjectManager::byId($objectId); - $eqLogics = $resultObject->getEqLogicBySummary($objectId, true, false); - } - $this->toHtmlEqLogics($html, $eqLogics); - $scenarios = ScenarioManager::byObjectId($objectId, false, true); - $scenariosResult = []; - if (count($scenarios) > 0) { - /** - * @var Scenario $scenario - */ - foreach ($scenarios as $scenario) { - $scenariosResult[] = [ - 'scenario_id' => $scenario->getId(), - 'state' => $scenario->getState(), - 'name' => $scenario->getName(), - 'icon' => $scenario->getDisplay('icon'), - 'active' => $scenario->getIsActive() - ]; - } + $htmlObject = $this->renderObjectAsHtml($objectId); + $scenariosObject = $this->renderScenariosAsHtml($objectId); + $this->ajax->success([Common::OBJECT_HTML => implode($htmlObject), NextDomObj::SCENARIOS => $scenariosObject]); + } + } + + private function renderObjectAsHtml($objectId) + { + $result = []; + if (Utils::init(AjaxParams::SUMMARY) == '') { + $eqLogics = EqLogicManager::byObjectId($objectId, true, true); + } else { + $resultObject = JeeObjectManager::byId($objectId); + $eqLogics = $resultObject->getEqLogicBySummary($objectId, true, false); + } + $this->toHtmlEqLogics($result, $eqLogics); + ksort($result); + return $result; + } + + private function renderScenariosAsHtml($objectId) + { + $scenarios = ScenarioManager::byObjectId($objectId, false, true); + $result = []; + if (count($scenarios) > 0) { + /** @var Scenario $scenario */ + foreach ($scenarios as $scenario) { + $result[] = [ + 'scenario_id' => $scenario->getId(), + 'state' => $scenario->getState(), + 'name' => $scenario->getName(), + 'icon' => $scenario->getDisplay('icon'), + 'active' => $scenario->getIsActive() + ]; } - ksort($html); - $this->ajax->success([Common::OBJECT_HTML => implode($html), NextDomObj::SCENARIOS => $scenariosResult]); } + return $result; } /** @@ -310,7 +298,7 @@ public function getSummaryHtml() if ($id == Common::GLOBAL) { $result[Common::GLOBAL] = [ Common::HTML => JeeObjectManager::getGlobalHtmlSummary($value[Common::VERSION]), - Common::ID => Common::GLOBAL + AjaxParams::ID => Common::GLOBAL ]; continue; } @@ -320,7 +308,7 @@ public function getSummaryHtml() } $result[$resultObject->getId()] = [ Common::HTML => $resultObject->getHtmlSummary($value[Common::VERSION]), - Common::ID => $resultObject->getId() + AjaxParams::ID => $resultObject->getId() ]; } $this->ajax->success($result); @@ -330,7 +318,7 @@ public function getSummaryHtml() throw new CoreException(__('Objet inconnu. Vérifiez l\'ID')); } $infoObject = []; - $infoObject[Common::ID] = $resultObject->getId(); + $infoObject[AjaxParams::ID] = $resultObject->getId(); $infoObject[Common::HTML] = $resultObject->getHtmlSummary(Utils::init(AjaxParams::VERSION)); $this->ajax->success($infoObject); } diff --git a/src/Ajax/ScenarioAjax.php b/src/Ajax/ScenarioAjax.php index aa4b87a52..6a73bcee1 100644 --- a/src/Ajax/ScenarioAjax.php +++ b/src/Ajax/ScenarioAjax.php @@ -67,6 +67,7 @@ public function changeState() throw new CoreException(__('Vous n\'êtes pas autorisé à faire cette action')); } switch (Utils::init(AjaxParams::STATE)) { + default: case 'start': if (!$scenario->getIsActive()) { throw new CoreException(__('Impossible de lancer le scénario car il est désactivé. Veuillez l\'activer')); @@ -110,10 +111,10 @@ public function setOrder() { $scenarios = json_decode(Utils::init(AjaxParams::SCENARIOS), true); foreach ($scenarios as $scenario_json) { - if (!isset($scenario_json[Common::ID]) || trim($scenario_json[Common::ID]) == '') { + if (!isset($scenario_json[AjaxParams::ID]) || trim($scenario_json[AjaxParams::ID]) == '') { continue; } - $scenario = ScenarioManager::byId($scenario_json[Common::ID]); + $scenario = ScenarioManager::byId($scenario_json[AjaxParams::ID]); if (!is_object($scenario)) { continue; } @@ -310,7 +311,7 @@ public function saveAll() $scenarios = json_decode(Utils::init(AjaxParams::SCENARIOS), true); if (is_array($scenarios)) { foreach ($scenarios as $scenario_ajax) { - $scenario = ScenarioManager::byId($scenario_ajax[Common::ID]); + $scenario = ScenarioManager::byId($scenario_ajax[AjaxParams::ID]); if (!is_object($scenario)) { continue; } @@ -437,7 +438,7 @@ public function get() if($scenarioLink->getId() == $scenario->getId()){ continue; } - $result['scenarioLinkBy'][NextDomObj::SCENARIO][$scenarioLink->getId()] = [Common::ID => $scenarioLink->getId(),Common::NAME => $scenarioLink->getHumanName(),'isActive' => $scenarioLink->getIsActive(),'isVisible' => $scenarioLink->getIsVisible()]; + $result['scenarioLinkBy'][NextDomObj::SCENARIO][$scenarioLink->getId()] = [AjaxParams::ID => $scenarioLink->getId(),Common::NAME => $scenarioLink->getHumanName(),'isActive' => $scenarioLink->getIsActive(),'isVisible' => $scenarioLink->getIsVisible()]; } $result['scenarioLinkIn'] = [NextDomObj::SCENARIO => []]; $scenarioUse = $scenario->getUse(); @@ -445,7 +446,7 @@ public function get() if($scenarioLink->getId() == $scenario->getId()){ continue; } - $result['scenarioLinkIn'][NextDomObj::SCENARIO][$scenarioLink->getId()] = [Common::ID => $scenarioLink->getId(),Common::NAME => $scenarioLink->getHumanName(),'isActive' => $scenarioLink->getIsActive(),'isVisible' => $scenarioLink->getIsVisible()]; + $result['scenarioLinkIn'][NextDomObj::SCENARIO][$scenarioLink->getId()] = [AjaxParams::ID => $scenarioLink->getId(),Common::NAME => $scenarioLink->getHumanName(),'isActive' => $scenarioLink->getIsActive(),'isVisible' => $scenarioLink->getIsVisible()]; } $this->ajax->success($result); } @@ -483,8 +484,8 @@ public function save() // Prepare object from Ajax data $scenarioAjaxData = json_decode(Utils::init(AjaxParams::SCENARIO), true); - if (isset($scenarioAjaxData[Common::ID])) { - $targetScenario = ScenarioManager::byId($scenarioAjaxData[Common::ID]); + if (isset($scenarioAjaxData[AjaxParams::ID])) { + $targetScenario = ScenarioManager::byId($scenarioAjaxData[AjaxParams::ID]); } if (!isset($targetScenario) || !is_object($targetScenario)) { $targetScenario = new Scenario(); @@ -533,7 +534,7 @@ public function actionToHtml() } $result[] = [ 'html' => $html, - Common::ID => $param[Common::ID], + AjaxParams::ID => $param[AjaxParams::ID], ]; } } diff --git a/src/Ajax/UpdateAjax.php b/src/Ajax/UpdateAjax.php index 655c4c00e..8593d8fb5 100644 --- a/src/Ajax/UpdateAjax.php +++ b/src/Ajax/UpdateAjax.php @@ -51,19 +51,17 @@ public function all() { AuthentificationHelper::isConnectedAsAdminOrFail(); $result = []; - /** - * @var Update $update - */ + /** @var Update $update */ foreach (UpdateManager::all(Utils::init(AjaxParams::FILTER)) as $update) { $infos = Utils::o2a($update); - if ($update->getType() == 'plugin') { + if ($update->getType() == AjaxParams::PLUGIN) { try { $plugin = PluginManager::byId($update->getLogicalId()); if (is_object($plugin)) { - $infos['plugin'] = Utils::o2a($plugin); - $infos['plugin']['icon'] = $plugin->getPathImgIcon(); + $infos[AjaxParams::PLUGIN] = Utils::o2a($plugin); + $infos[AjaxParams::PLUGIN]['icon'] = $plugin->getPathImgIcon(); } else { - $infos['plugin'] = []; + $infos[AjaxParams::PLUGIN] = []; } } catch (\Exception $e) { @@ -97,7 +95,7 @@ public function update() if ($update->getType() != 'core') { LogHelper::addAlert(LogTarget::UPDATE, __("Launch cron dependancy plugins")); try { - $cron = CronManager::byClassAndFunction('plugin', 'checkDeamon'); + $cron = CronManager::byClassAndFunction(AjaxParams::PLUGIN, 'checkDeamon'); if (is_object($cron)) { $cron->start(); } @@ -159,8 +157,8 @@ public function save() $backupUpdate = null; $updateDataJson = json_decode(Utils::init(AjaxParams::UPDATE), true); - if (isset($updateDataJson[Common::ID])) { - $targetUpdate = UpdateManager::byId($updateDataJson[Common::ID]); + if (isset($updateDataJson[AjaxParams::ID])) { + $targetUpdate = UpdateManager::byId($updateDataJson[AjaxParams::ID]); } elseif (isset($updateDataJson['logicalId'])) { $targetUpdate = UpdateManager::byLogicalId($updateDataJson[Common::LOGICAL_ID]); } diff --git a/src/Controller/Pages/AdministrationController.php b/src/Controller/Pages/AdministrationController.php index cb09121e9..9e18edf43 100644 --- a/src/Controller/Pages/AdministrationController.php +++ b/src/Controller/Pages/AdministrationController.php @@ -151,7 +151,6 @@ function ($value) { private static function countErrorLog(&$pageData) { $pageData['logCount'] = 0; - Utils::init('logfile'); $logFilesList = []; $dir = opendir(NEXTDOM_LOG); while ($file = readdir($dir)) { diff --git a/src/Enums/AjaxParams.php b/src/Enums/AjaxParams.php index af52c3325..0e2a9775a 100644 --- a/src/Enums/AjaxParams.php +++ b/src/Enums/AjaxParams.php @@ -40,6 +40,7 @@ class AjaxParams extends Enum const ENABLE = 'enable'; const EQLOGIC_NAME = 'eqLogic_name'; const EQTYPE_NAME = 'eqType_name'; + const EVENT_STR = 'event_str'; const EXPRESSION = 'expression'; const FILTER = 'filter'; const FORCE_RESTART = 'forceRestart'; diff --git a/src/Enums/Common.php b/src/Enums/Common.php index 2d9a6515d..2505adc11 100644 --- a/src/Enums/Common.php +++ b/src/Enums/Common.php @@ -36,6 +36,7 @@ class Common extends Enum const CMD_ID = 'cmd_id'; const CMD_PARAMETERS = 'cmd_parameters'; const COLOR = 'color'; + const COLUMN = 'column'; const CONFIGURATION = 'configuration'; const CORE = 'core'; const CUSTOM = 'custom';