From 0b0fcf0fa8bf7a21a76a01b841cb6045110cfe39 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Tue, 6 Feb 2024 09:51:26 +0100 Subject: [PATCH 01/15] 7132 - Portal & silo : unable to see workflow graph on some objects --- module.combodo-workflow-graphical-view.php | 2 + src/Hook/PortalUIExtension.php | 3 +- .../Controller/LifecycleBrickController.php | 135 ++++++++++++++++++ src/Portal/Router/LifecycleBrickRouter.php | 49 +++++++ 4 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 src/Portal/Controller/LifecycleBrickController.php create mode 100644 src/Portal/Router/LifecycleBrickRouter.php diff --git a/module.combodo-workflow-graphical-view.php b/module.combodo-workflow-graphical-view.php index 32a6742..c51a5e1 100644 --- a/module.combodo-workflow-graphical-view.php +++ b/module.combodo-workflow-graphical-view.php @@ -38,6 +38,8 @@ 'datamodel' => array( // Module's autoloader 'vendor/autoload.php', + 'src/Portal/Controller/LifecycleBrickController.php', + 'src/Portal/Router/LifecycleBrickRouter.php', // Explicitly load APIs classes 'src/Hook/ConsoleUIExtension.php', 'src/Hook/PortalUIExtension.php', diff --git a/src/Hook/PortalUIExtension.php b/src/Hook/PortalUIExtension.php index 672f56c..294fc6f 100644 --- a/src/Hook/PortalUIExtension.php +++ b/src/Hook/PortalUIExtension.php @@ -87,7 +87,8 @@ public function GetJSInline(Container $oContainer) $sWidgetName = LifecycleManager::GetJSWidgetNameForUI(); $sShowButtonCSSClassesAsJSON = json_encode(LifecycleManager::GetShowButtonCSSClasses()); $sLegendHTMLAsJSON = json_encode(LifecycleManager::GetLegendHTMLMarkup()); - $sEndpoint = LifecycleManager::GetEndpoint(); + $oRouter = $oContainer->get('router'); + $sEndpoint = $oRouter->generate('p_lifecycle_view_object'); $sDictEntryShowButtonTooltipAsJSON = json_encode(Dict::S('workflow-graphical-view:UI:Button:ShowLifecycle')); $sDictEntryModalTitleAsJSON = json_encode(Dict::S('workflow-graphical-view:UI:Modal:Title')); diff --git a/src/Portal/Controller/LifecycleBrickController.php b/src/Portal/Controller/LifecycleBrickController.php new file mode 100644 index 0000000..c0b805f --- /dev/null +++ b/src/Portal/Controller/LifecycleBrickController.php @@ -0,0 +1,135 @@ +oScopeValidatorHelper->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjectClass)); + return $oObject; +} + + /** + * @param \Symfony\Component\HttpFoundation\Request $oRequest + * + * @return \Symfony\Component\HttpFoundation\Response + * @throws \ArchivedObjectException + * @throws \Combodo\iTop\Portal\Brick\BrickNotFoundException + * @throws \CoreException + * @throws \CoreUnexpectedValue + * @throws \DictExceptionMissingString + * @throws \MySQLException + * @throws \OQLException + */ + public function ViewObjectLifecycleAction(Request $oRequest) + { + + $sObjClass = utils::ReadParam('object_class', '', false, 'class'); + $iObjID = (int) utils::ReadParam('object_id', 0, false, 'integer'); + $sOutputFormat = utils::ReadParam('output_format', 'image'); + try + { + $oObject = MetaModel::GetObject($sObjClass, $iObjID, true, $this->oScopeValidatorHelper->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjClass)); + + + if(!LifecycleManager::IsEligibleObject($oObject)) + { + throw new Exception('TOTR: Cannot show lifecycle for '.$sObjClass.'#'.$iObjID.', object is not eligible.'); + } + + // Get module parameters + // - stimuli to hide + $aStimuliToHide = array(); + $aModuleParameter = ConfigHelper::GetModuleSetting('stimuli_to_hide'); + if(is_array($aModuleParameter) && isset($aModuleParameter[$sObjClass])) + { + foreach(explode(',', $aModuleParameter[$sObjClass]) as $sStimulusCode) + { + $aStimuliToHide[] = trim($sStimulusCode); + } + } + // - internal stimuli to hide + $bHideInternalStimuli = ConfigHelper::GetModuleSetting('hide_internal_stimuli'); + + $oLM = new LifecycleManager($oObject); + $sImageFilePath = $oLM->GetLifecycleImage($aStimuliToHide, $bHideInternalStimuli); + + $aHeaders=[]; + $sFileContent = null; + // Send content + switch($sOutputFormat) + { + case 'base64': + $aHeaders['Content-type'] = 'text/plain'; + $sFileContent = base64_encode(file_get_contents($sImageFilePath)); + break; + + case 'binary': + default: + $aHeaders['Content-type'] = 'image/png'; + $sFileContent = file_get_contents($sImageFilePath); + break; + } + + + // If image in temp. dir., we delete it (means that it's not the default image) + if(stripos($sImageFilePath, GraphvizGenerator::$sTmpFolderPath) !== false) + { + @unlink($sImageFilePath); + } + return new Response( $sFileContent, Response::HTTP_OK, $aHeaders); + } + catch(Exception $oException) + { + $aHeaders['Content-type'] = 'text/html'; + return new Response( "

{$oException->getMessage()}

",Response::HTTP_INTERNAL_SERVER_ERROR, $aHeaders); + } + } + + +} diff --git a/src/Portal/Router/LifecycleBrickRouter.php b/src/Portal/Router/LifecycleBrickRouter.php new file mode 100644 index 0000000..b3858c7 --- /dev/null +++ b/src/Portal/Router/LifecycleBrickRouter.php @@ -0,0 +1,49 @@ + '/lifecycle/view', + 'callback' => 'Combodo\\iTop\\Portal\\Controller\\LifecycleBrickController::ViewObjectLifecycleAction', + 'bind' => 'p_lifecycle_view_object' + ), + ) +); + +/** + * @since 3.1.0 + */ +//remove require itopdesignformat at the same time as version_compare(ITOP_DESIGN_LATEST_VERSION , '3.0') < 0 +if (! defined("ITOP_DESIGN_LATEST_VERSION")) { + require_once APPROOT.'setup/itopdesignformat.class.inc.php'; +} +if (version_compare(ITOP_DESIGN_LATEST_VERSION, 3.1, '>=')) { + /** @noinspection PhpUnhandledExceptionInspection */ + ItopExtensionsExtraRoutes::AddControllersClasses( + array( + 'Combodo\iTop\Portal\Controller\LifecycleBrickController' + ) + ); +} \ No newline at end of file From 29c6f1156e7458effb257966abc97ea7b160bfa7 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 1 Mar 2024 10:23:15 +0100 Subject: [PATCH 02/15] refactor + add dictionary entries --- vendor/composer/autoload_classmap.php | 2 ++ vendor/composer/autoload_static.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index a001fd5..700ab56 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -9,6 +9,8 @@ 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Extension\\ConsoleUIExtension' => $baseDir . '/src/Hook/ConsoleUIExtension.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Extension\\PortalUIExtension' => $baseDir . '/src/Hook/PortalUIExtension.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\ConfigHelper' => $baseDir . '/src/Helper/ConfigHelper.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\LifeCycleGraphHelper' => $baseDir . '/src/Helper/LifeCycleGraphHelper.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Router\\LifecycleBrickRouter' => $baseDir . '/src/Portal/Router/LifecycleBrickRouter.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\GraphvizGenerator' => $baseDir . '/src/Service/GraphvizGenerator.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\LifecycleManager' => $baseDir . '/src/Service/LifecycleManager.php', ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 385151b..ae69925 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -26,6 +26,8 @@ class ComposerStaticInit8e40dbcbd20280eb1498a6aa84fb9d6f 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\ConfigHelper' => __DIR__ . '/../..' . '/src/Helper/ConfigHelper.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\GraphvizGenerator' => __DIR__ . '/../..' . '/src/Service/GraphvizGenerator.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\LifecycleManager' => __DIR__ . '/../..' . '/src/Service/LifecycleManager.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\LifeCycleGraphHelper' => __DIR__ . '/../..'. '/src/Helper/LifeCycleGraphHelper.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Router\\LifecycleBrickRouter' => __DIR__ . '/../..'. '/src/Portal/Router/LifecycleBrickRouter.php', ); public static function getInitializer(ClassLoader $loader) From 72f46887ff1795e3f91b67685ea25f55c961fa6e Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 1 Mar 2024 10:27:20 +0100 Subject: [PATCH 03/15] refactor + add dictionary entries --- src/Helper/LifecycleGraphHelper.php | 86 ++++++++++++++++ .../Controller/LifecycleBrickController.php | 97 +++---------------- 2 files changed, 98 insertions(+), 85 deletions(-) create mode 100644 src/Helper/LifecycleGraphHelper.php diff --git a/src/Helper/LifecycleGraphHelper.php b/src/Helper/LifecycleGraphHelper.php new file mode 100644 index 0000000..6a72ac8 --- /dev/null +++ b/src/Helper/LifecycleGraphHelper.php @@ -0,0 +1,86 @@ +GetLifecycleImage($aStimuliToHide, $bHideInternalStimuli); + + $aHeaders = []; + $sFileContent = null; + // Send content + switch ($sOutputFormat) { + case 'base64': + $aHeaders['Content-type'] = 'text/plain'; + $sFileContent = base64_encode(file_get_contents($sImageFilePath)); + break; + + case 'binary': + default: + $aHeaders['Content-type'] = 'image/png'; + $sFileContent = file_get_contents($sImageFilePath); + break; + } + + + // If image in temp. dir., we delete it (means that it's not the default image) + if (stripos($sImageFilePath, GraphvizGenerator::$sTmpFolderPath) !== false) { + @unlink($sImageFilePath); + } + + return [$sFileContent, Response::HTTP_OK, $aHeaders]; + } + catch (Exception $oException) { + $aHeaders['Content-type'] = 'text/html'; + + return ["

{$oException->getMessage()}

", Response::HTTP_INTERNAL_SERVER_ERROR, $aHeaders]; + } + } +} \ No newline at end of file diff --git a/src/Portal/Controller/LifecycleBrickController.php b/src/Portal/Controller/LifecycleBrickController.php index c0b805f..305c620 100644 --- a/src/Portal/Controller/LifecycleBrickController.php +++ b/src/Portal/Controller/LifecycleBrickController.php @@ -1,43 +1,17 @@ oScopeValidatorHelper->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjectClass)); - return $oObject; -} + return $oObject; + } /** * @param \Symfony\Component\HttpFoundation\Request $oRequest @@ -68,67 +42,20 @@ public function GetObject($sObjectClass, $sObjectId){ */ public function ViewObjectLifecycleAction(Request $oRequest) { - $sObjClass = utils::ReadParam('object_class', '', false, 'class'); $iObjID = (int) utils::ReadParam('object_id', 0, false, 'integer'); $sOutputFormat = utils::ReadParam('output_format', 'image'); try { - $oObject = MetaModel::GetObject($sObjClass, $iObjID, true, $this->oScopeValidatorHelper->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjClass)); - - - if(!LifecycleManager::IsEligibleObject($oObject)) - { - throw new Exception('TOTR: Cannot show lifecycle for '.$sObjClass.'#'.$iObjID.', object is not eligible.'); + $oObject = MetaModel::GetObject($sObjClass, $iObjID, true, $this->oScopeValidatorHelper->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjClass)); + [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($sObjClass, $iObjID, $oObject, $sOutputFormat); + return new Response($sContent, $sHttpResponseCode, $aHeaders); } - - // Get module parameters - // - stimuli to hide - $aStimuliToHide = array(); - $aModuleParameter = ConfigHelper::GetModuleSetting('stimuli_to_hide'); - if(is_array($aModuleParameter) && isset($aModuleParameter[$sObjClass])) + catch(Exception $oException) { - foreach(explode(',', $aModuleParameter[$sObjClass]) as $sStimulusCode) - { - $aStimuliToHide[] = trim($sStimulusCode); - } + $aHeaders['Content-type'] = 'text/html'; + return new Response( "

{$oException->getMessage()}

",Response::HTTP_INTERNAL_SERVER_ERROR, $aHeaders); } - // - internal stimuli to hide - $bHideInternalStimuli = ConfigHelper::GetModuleSetting('hide_internal_stimuli'); - - $oLM = new LifecycleManager($oObject); - $sImageFilePath = $oLM->GetLifecycleImage($aStimuliToHide, $bHideInternalStimuli); - - $aHeaders=[]; - $sFileContent = null; - // Send content - switch($sOutputFormat) - { - case 'base64': - $aHeaders['Content-type'] = 'text/plain'; - $sFileContent = base64_encode(file_get_contents($sImageFilePath)); - break; - - case 'binary': - default: - $aHeaders['Content-type'] = 'image/png'; - $sFileContent = file_get_contents($sImageFilePath); - break; - } - - - // If image in temp. dir., we delete it (means that it's not the default image) - if(stripos($sImageFilePath, GraphvizGenerator::$sTmpFolderPath) !== false) - { - @unlink($sImageFilePath); - } - return new Response( $sFileContent, Response::HTTP_OK, $aHeaders); - } - catch(Exception $oException) - { - $aHeaders['Content-type'] = 'text/html'; - return new Response( "

{$oException->getMessage()}

",Response::HTTP_INTERNAL_SERVER_ERROR, $aHeaders); - } } From a69b3df8e25816f1064eea55eb77b4860d2215d1 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 1 Mar 2024 10:28:49 +0100 Subject: [PATCH 04/15] refactor + add dictionary entries --- ajax-operations.php | 62 +++---------------- cs.dict.combodo-workflow-graphical-view.php | 1 + da.dict.combodo-workflow-graphical-view.php | 1 + de.dict.combodo-workflow-graphical-view.php | 1 + en.dict.combodo-workflow-graphical-view.php | 1 + ...r.dict.combodo-workflow-graphical-view.php | 1 + fr.dict.combodo-workflow-graphical-view.php | 1 + hu.dict.combodo-workflow-graphical-view.php | 1 + it.dict.combodo-workflow-graphical-view.php | 1 + ja.dict.combodo-workflow-graphical-view.php | 1 + module.combodo-workflow-graphical-view.php | 1 - nl.dict.combodo-workflow-graphical-view.php | 1 + pl.dict.combodo-workflow-graphical-view.php | 1 + ...r.dict.combodo-workflow-graphical-view.php | 1 + ru.dict.combodo-workflow-graphical-view.php | 1 + sk.dict.combodo-workflow-graphical-view.php | 1 + tr.dict.combodo-workflow-graphical-view.php | 1 + ...n.dict.combodo-workflow-graphical-view.php | 1 + 18 files changed, 24 insertions(+), 55 deletions(-) diff --git a/ajax-operations.php b/ajax-operations.php index ce4d5b6..c917c37 100644 --- a/ajax-operations.php +++ b/ajax-operations.php @@ -19,12 +19,11 @@ namespace Combodo\iTop\Extension\WorkflowGraphicalView; -use Combodo\iTop\Extension\WorkflowGraphicalView\Helper\ConfigHelper; -use Combodo\iTop\Extension\WorkflowGraphicalView\Service\GraphvizGenerator; -use Combodo\iTop\Extension\WorkflowGraphicalView\Service\LifecycleManager; +use Combodo\iTop\Extension\WorkflowGraphicalView\Helper\LifecycleGraphHelper; use Exception; use LoginWebPage; use MetaModel; +use Symfony\Component\HttpFoundation\Response; use utils; // Note: approot.inc.php is relative to /pages/exc.php, so calls to this page must be done through it! @@ -45,61 +44,16 @@ { // Retrieve object $oObject = MetaModel::GetObject($sObjClass, $iObjID); + [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($sObjClass, $iObjID, $oObject, $sOutputFormat); - if(!LifecycleManager::IsEligibleObject($oObject)) - { - throw new Exception('TOTR: Cannot show lifecycle for '.$sObjClass.'#'.$iObjID.', object is not eligible.'); - } + //http_response_code($sHttpResponseCode); + header('Content-type: '.$aHeaders['Content-type']); + echo $sContent; - // Get module parameters - // - stimuli to hide - $aStimuliToHide = array(); - $aModuleParameter = ConfigHelper::GetModuleSetting('stimuli_to_hide'); - if(is_array($aModuleParameter) && isset($aModuleParameter[$sObjClass])) - { - foreach(explode(',', $aModuleParameter[$sObjClass]) as $sStimulusCode) - { - $aStimuliToHide[] = trim($sStimulusCode); - } - } - // - internal stimuli to hide - $bHideInternalStimuli = ConfigHelper::GetModuleSetting('hide_internal_stimuli'); - - $oLM = new LifecycleManager($oObject); - $sImageFilePath = $oLM->GetLifecycleImage($aStimuliToHide, $bHideInternalStimuli); - - // Send content - switch($sOutputFormat) - { - case 'base64': - header('Content-type: text/plain'); - echo base64_encode(file_get_contents($sImageFilePath)); - break; - - case 'binary': - default: - header('Content-type: image/png'); - echo file_get_contents($sImageFilePath); - break; - } - - - // If image in temp. dir., we delete it (means that it's not the default image) - if(stripos($sImageFilePath, GraphvizGenerator::$sTmpFolderPath) !== false) - { - @unlink($sImageFilePath); - } } catch(Exception $oException) { - http_response_code(500); + http_response_code(Response::HTTP_INTERNAL_SERVER_ERROR); header('Content-type: text/html'); echo "

{$oException->getMessage()}

"; -} - -//$oController = new AjaxOperationsController(MODULESROOT.ConfigHelper::GetModuleCode().'/view', ConfigHelper::GetModuleCode()); -// -//// Allow parallel execution -//session_write_close(); -// -//$oController->HandleOperation(); +} \ No newline at end of file diff --git a/cs.dict.combodo-workflow-graphical-view.php b/cs.dict.combodo-workflow-graphical-view.php index d5e3842..1c6710f 100644 --- a/cs.dict.combodo-workflow-graphical-view.php +++ b/cs.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/da.dict.combodo-workflow-graphical-view.php b/da.dict.combodo-workflow-graphical-view.php index fbd17e0..d624186 100644 --- a/da.dict.combodo-workflow-graphical-view.php +++ b/da.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/de.dict.combodo-workflow-graphical-view.php b/de.dict.combodo-workflow-graphical-view.php index 35fde2f..a76811b 100644 --- a/de.dict.combodo-workflow-graphical-view.php +++ b/de.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Interne Statusübergänge', 'workflow-graphical-view:Error:NoStateAttribute' => 'Es kann kein Lebenszyklusdiagramm für %1$s erstellt werden, da es kein Statusattribut hat.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Hoppla! Der Lebenszyklus konnte nicht erstellt werden. Überprüfen Sie das Error-Log für weitere Informationen.', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/en.dict.combodo-workflow-graphical-view.php b/en.dict.combodo-workflow-graphical-view.php index c10fc16..8f9ec9f 100644 --- a/en.dict.combodo-workflow-graphical-view.php +++ b/en.dict.combodo-workflow-graphical-view.php @@ -25,4 +25,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible', )); diff --git a/es_cr.dict.combodo-workflow-graphical-view.php b/es_cr.dict.combodo-workflow-graphical-view.php index c340bfb..edb5c60 100644 --- a/es_cr.dict.combodo-workflow-graphical-view.php +++ b/es_cr.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/fr.dict.combodo-workflow-graphical-view.php b/fr.dict.combodo-workflow-graphical-view.php index bdc90a2..85e50b8 100644 --- a/fr.dict.combodo-workflow-graphical-view.php +++ b/fr.dict.combodo-workflow-graphical-view.php @@ -13,4 +13,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Transitions internes', 'workflow-graphical-view:Error:NoStateAttribute' => 'Impossible de générer le graphique du cycle de vie pour %1$s car la classe n\'a pas d\'attribut portant le cycle de vie.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Oups ! Le cycle de vie n\'a pas pu être chargé, vérifiez le journal des erreurs pour plus d\'informations.', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Impossible d\'afficher le cycle de vie pour l\'objet %1$s#%2$s, il n\'est pas disponible.', )); diff --git a/hu.dict.combodo-workflow-graphical-view.php b/hu.dict.combodo-workflow-graphical-view.php index c3972f6..e92d64a 100644 --- a/hu.dict.combodo-workflow-graphical-view.php +++ b/hu.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/it.dict.combodo-workflow-graphical-view.php b/it.dict.combodo-workflow-graphical-view.php index de1fc46..9f513c5 100644 --- a/it.dict.combodo-workflow-graphical-view.php +++ b/it.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/ja.dict.combodo-workflow-graphical-view.php b/ja.dict.combodo-workflow-graphical-view.php index 927a215..0332873 100644 --- a/ja.dict.combodo-workflow-graphical-view.php +++ b/ja.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/module.combodo-workflow-graphical-view.php b/module.combodo-workflow-graphical-view.php index c51a5e1..8ee50ae 100644 --- a/module.combodo-workflow-graphical-view.php +++ b/module.combodo-workflow-graphical-view.php @@ -39,7 +39,6 @@ // Module's autoloader 'vendor/autoload.php', 'src/Portal/Controller/LifecycleBrickController.php', - 'src/Portal/Router/LifecycleBrickRouter.php', // Explicitly load APIs classes 'src/Hook/ConsoleUIExtension.php', 'src/Hook/PortalUIExtension.php', diff --git a/nl.dict.combodo-workflow-graphical-view.php b/nl.dict.combodo-workflow-graphical-view.php index 7a77b0f..9df4939 100644 --- a/nl.dict.combodo-workflow-graphical-view.php +++ b/nl.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/pl.dict.combodo-workflow-graphical-view.php b/pl.dict.combodo-workflow-graphical-view.php index 3c5924b..de6e710 100644 --- a/pl.dict.combodo-workflow-graphical-view.php +++ b/pl.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/pt_br.dict.combodo-workflow-graphical-view.php b/pt_br.dict.combodo-workflow-graphical-view.php index dabb1c1..8fb92ca 100644 --- a/pt_br.dict.combodo-workflow-graphical-view.php +++ b/pt_br.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/ru.dict.combodo-workflow-graphical-view.php b/ru.dict.combodo-workflow-graphical-view.php index bee3709..2269b39 100644 --- a/ru.dict.combodo-workflow-graphical-view.php +++ b/ru.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/sk.dict.combodo-workflow-graphical-view.php b/sk.dict.combodo-workflow-graphical-view.php index 914cc01..ebbf54a 100644 --- a/sk.dict.combodo-workflow-graphical-view.php +++ b/sk.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/tr.dict.combodo-workflow-graphical-view.php b/tr.dict.combodo-workflow-graphical-view.php index 9422b85..45ad540 100644 --- a/tr.dict.combodo-workflow-graphical-view.php +++ b/tr.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); diff --git a/zh_cn.dict.combodo-workflow-graphical-view.php b/zh_cn.dict.combodo-workflow-graphical-view.php index 6fcf1ac..da34209 100644 --- a/zh_cn.dict.combodo-workflow-graphical-view.php +++ b/zh_cn.dict.combodo-workflow-graphical-view.php @@ -24,4 +24,5 @@ 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', )); From 77290f527f25b77d23df0a282541c21d287fb5b6 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 1 Mar 2024 17:39:34 +0100 Subject: [PATCH 05/15] remove "Response::..." --- ajax-operations.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ajax-operations.php b/ajax-operations.php index c917c37..42572ae 100644 --- a/ajax-operations.php +++ b/ajax-operations.php @@ -23,7 +23,6 @@ use Exception; use LoginWebPage; use MetaModel; -use Symfony\Component\HttpFoundation\Response; use utils; // Note: approot.inc.php is relative to /pages/exc.php, so calls to this page must be done through it! @@ -53,7 +52,7 @@ } catch(Exception $oException) { - http_response_code(Response::HTTP_INTERNAL_SERVER_ERROR); + http_response_code(500); header('Content-type: text/html'); echo "

{$oException->getMessage()}

"; } \ No newline at end of file From 729d93dc78dc64ca3b4b030de3839b42b6feb23a Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Mon, 4 Mar 2024 15:28:43 +0100 Subject: [PATCH 06/15] Fix import --- module.combodo-workflow-graphical-view.php | 2 +- .../Controller/LifecycleBrickController.php | 3 +- src/Portal/Router/LifecycleBrickRouter.php | 4 +- vendor/autoload.php | 18 ++ vendor/composer/ClassLoader.php | 204 +++++++++++++++--- vendor/composer/autoload_classmap.php | 9 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_real.php | 18 +- vendor/composer/autoload_static.php | 7 +- 10 files changed, 207 insertions(+), 62 deletions(-) diff --git a/module.combodo-workflow-graphical-view.php b/module.combodo-workflow-graphical-view.php index 8ee50ae..c069b5d 100644 --- a/module.combodo-workflow-graphical-view.php +++ b/module.combodo-workflow-graphical-view.php @@ -38,8 +38,8 @@ 'datamodel' => array( // Module's autoloader 'vendor/autoload.php', - 'src/Portal/Controller/LifecycleBrickController.php', // Explicitly load APIs classes + 'src/Portal/Router/LifecycleBrickRouter.php', 'src/Hook/ConsoleUIExtension.php', 'src/Hook/PortalUIExtension.php', ), diff --git a/src/Portal/Controller/LifecycleBrickController.php b/src/Portal/Controller/LifecycleBrickController.php index 305c620..ddd3f29 100644 --- a/src/Portal/Controller/LifecycleBrickController.php +++ b/src/Portal/Controller/LifecycleBrickController.php @@ -5,10 +5,11 @@ * @license http://opensource.org/licenses/AGPL-3.0 */ -namespace Combodo\iTop\Portal\Controller; +namespace Combodo\iTop\Extension\WorkflowGraphicalView\Portal\Controller; use ApprovalScheme; use Combodo\iTop\Extension\WorkflowGraphicalView\Helper\LifecycleGraphHelper; +use Combodo\iTop\Portal\Controller\ObjectController; use MetaModel; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Portal/Router/LifecycleBrickRouter.php b/src/Portal/Router/LifecycleBrickRouter.php index b3858c7..e294322 100644 --- a/src/Portal/Router/LifecycleBrickRouter.php +++ b/src/Portal/Router/LifecycleBrickRouter.php @@ -26,7 +26,7 @@ ItopExtensionsExtraRoutes::AddRoutes( array( array('pattern' => '/lifecycle/view', - 'callback' => 'Combodo\\iTop\\Portal\\Controller\\LifecycleBrickController::ViewObjectLifecycleAction', + 'callback' => 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController::ViewObjectLifecycleAction', 'bind' => 'p_lifecycle_view_object' ), ) @@ -43,7 +43,7 @@ /** @noinspection PhpUnhandledExceptionInspection */ ItopExtensionsExtraRoutes::AddControllersClasses( array( - 'Combodo\iTop\Portal\Controller\LifecycleBrickController' + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController' ) ); } \ No newline at end of file diff --git a/vendor/autoload.php b/vendor/autoload.php index d6b9ae5..538883d 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit8e40dbcbd20280eb1498a6aa84fb9d6f::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index fce8549..7824d8f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -37,57 +37,126 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + // PSR-4 + /** + * @var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var list + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ private $prefixesPsr0 = array(); + /** + * @var list + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var array + */ private $missingClasses = array(); + + /** @var string|null */ private $apcuPrefix; + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } + /** + * @return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return list + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return list + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return array Array of classname => path + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param array $classMap Class to filename map + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,22 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -126,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -147,25 +219,28 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -175,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -195,8 +270,10 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +288,12 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +313,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +337,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +359,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,33 +381,55 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } + + return null; } /** @@ -367,6 +474,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -432,14 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 700ab56..79d462d 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,15 +2,14 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Extension\\ConsoleUIExtension' => $baseDir . '/src/Hook/ConsoleUIExtension.php', - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Extension\\PortalUIExtension' => $baseDir . '/src/Hook/PortalUIExtension.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\ConfigHelper' => $baseDir . '/src/Helper/ConfigHelper.php', - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\LifeCycleGraphHelper' => $baseDir . '/src/Helper/LifeCycleGraphHelper.php', - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Router\\LifecycleBrickRouter' => $baseDir . '/src/Portal/Router/LifecycleBrickRouter.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\LifecycleGraphHelper' => $baseDir . '/src/Helper/LifecycleGraphHelper.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController' => $baseDir . '/src/Portal/Controller/LifecycleBrickController.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\GraphvizGenerator' => $baseDir . '/src/Service/GraphvizGenerator.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\LifecycleManager' => $baseDir . '/src/Service/LifecycleManager.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc012..15a2ff3 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 821da76..55868e9 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 3b6703e..5326ad8 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -13,6 +13,9 @@ public static function loadClassLoader($class) } } + /** + * @return \Composer\Autoload\ClassLoader + */ public static function getLoader() { if (null !== self::$loader) { @@ -20,20 +23,11 @@ public static function getLoader() } spl_autoload_register(array('ComposerAutoloaderInit8e40dbcbd20280eb1498a6aa84fb9d6f', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit8e40dbcbd20280eb1498a6aa84fb9d6f', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit8e40dbcbd20280eb1498a6aa84fb9d6f::getInitializer($loader)); - } else { - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit8e40dbcbd20280eb1498a6aa84fb9d6f::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ae69925..4a07068 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -21,13 +21,12 @@ class ComposerStaticInit8e40dbcbd20280eb1498a6aa84fb9d6f ); public static $classMap = array ( - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Extension\\ConsoleUIExtension' => __DIR__ . '/../..' . '/src/Hook/ConsoleUIExtension.php', - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Extension\\PortalUIExtension' => __DIR__ . '/../..' . '/src/Hook/PortalUIExtension.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\ConfigHelper' => __DIR__ . '/../..' . '/src/Helper/ConfigHelper.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\LifecycleGraphHelper' => __DIR__ . '/../..' . '/src/Helper/LifecycleGraphHelper.php', + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController' => __DIR__ . '/../..' . '/src/Portal/Controller/LifecycleBrickController.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\GraphvizGenerator' => __DIR__ . '/../..' . '/src/Service/GraphvizGenerator.php', 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Service\\LifecycleManager' => __DIR__ . '/../..' . '/src/Service/LifecycleManager.php', - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Helper\\LifeCycleGraphHelper' => __DIR__ . '/../..'. '/src/Helper/LifeCycleGraphHelper.php', - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Router\\LifecycleBrickRouter' => __DIR__ . '/../..'. '/src/Portal/Router/LifecycleBrickRouter.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) From fdea5e5208dec00e316541a6a5b0f89373d76b82 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 8 Mar 2024 11:20:59 +0100 Subject: [PATCH 07/15] Fix 3.2 compatibility --- src/Hook/ConsoleUIExtension.php | 34 +++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/Hook/ConsoleUIExtension.php b/src/Hook/ConsoleUIExtension.php index fa20c34..ada2c32 100644 --- a/src/Hook/ConsoleUIExtension.php +++ b/src/Hook/ConsoleUIExtension.php @@ -41,13 +41,11 @@ class ConsoleUIExtension extends AbstractApplicationUIExtension public function OnDisplayProperties($oObject, WebPage $oPage, $bEditMode = false) { // Check if extension allowed - if(!ConfigHelper::IsAllowed('backoffice')) - { + if (!ConfigHelper::IsAllowed('backoffice')) { return; } - if(!LifecycleManager::IsEligibleObject($oObject)) - { + if (!LifecycleManager::IsEligibleObject($oObject)) { return; } @@ -56,14 +54,30 @@ public function OnDisplayProperties($oObject, WebPage $oPage, $bEditMode = false $aJSFiles = $oLM->GetJSFilesUrls(); $sJSWidgetSnippet = $oLM->GetJSWidgetSnippetForObjectDetails(); - // Add resources - foreach($aCSSFiles as $sCSSFile) - { - $oPage->add_linked_stylesheet($sCSSFile); + /** + * @since 3.2.0 + */ + //remove require itopdesignformat at the same time as version_compare(ITOP_DESIGN_LATEST_VERSION , '3.2') < 0 + if (!defined("ITOP_DESIGN_LATEST_VERSION")) { + require_once APPROOT.'setup/itopdesignformat.class.inc.php'; } - foreach($aJSFiles as $sJSFile) + if (version_compare(ITOP_DESIGN_LATEST_VERSION, 3.2, '>=')) { + // Add resources + foreach ($aCSSFiles as $sCSSFile) { + $oPage->LinkStylesheetFromURI($sCSSFile); + } + foreach ($aJSFiles as $sJSFile) { + $oPage->LinkScriptFromURI($sJSFile); + } + } else { - $oPage->add_linked_script($sJSFile); + // Add resources + foreach ($aCSSFiles as $sCSSFile) { + $oPage->add_linked_stylesheet($sCSSFile); + } + foreach ($aJSFiles as $sJSFile) { + $oPage->add_linked_script($sJSFile); + } } // Add script From e82a49277056cf3ee692f2aa123e1bacbbeffd30 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Wed, 4 Sep 2024 11:46:38 +0200 Subject: [PATCH 08/15] Change made in PR review --- ajax-operations.php | 11 ++-- datamodel.combodo-workflow-graphical-view.xml | 2 +- module.combodo-workflow-graphical-view.php | 7 ++- src/Helper/LifecycleGraphHelper.php | 5 +- .../Controller/LifecycleBrickController.php | 58 +++++++------------ src/Portal/Router/LifecycleBrickRouter.php | 42 ++++++-------- 6 files changed, 54 insertions(+), 71 deletions(-) diff --git a/ajax-operations.php b/ajax-operations.php index 42572ae..86145f2 100644 --- a/ajax-operations.php +++ b/ajax-operations.php @@ -32,20 +32,19 @@ require_once APPROOT.'/application/loginwebpage.class.inc.php'; // Check user is logged in -LoginWebPage::DoLoginEx(null, false); +LoginWebPage::DoLoginEx('backoffice', false); // Retrieve parameters -$sObjClass = utils::ReadParam('object_class', '', false, 'class'); -$iObjID = (int) utils::ReadParam('object_id', 0, false, 'integer'); -$sOutputFormat = utils::ReadParam('output_format', 'image'); +$sObjClass = utils::ReadParam('object_class', '', false, utils::ENUM_SANITIZATION_FILTER_CLASS); +$iObjID = (int) utils::ReadParam('object_id', 0, false, utils::ENUM_SANITIZATION_FILTER_INTEGER); +$sOutputFormat = utils::ReadParam('output_format', 'image', false, utils::ENUM_SANITIZATION_FILTER_PARAMETER); try { // Retrieve object $oObject = MetaModel::GetObject($sObjClass, $iObjID); - [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($sObjClass, $iObjID, $oObject, $sOutputFormat); + [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); - //http_response_code($sHttpResponseCode); header('Content-type: '.$aHeaders['Content-type']); echo $sContent; diff --git a/datamodel.combodo-workflow-graphical-view.xml b/datamodel.combodo-workflow-graphical-view.xml index c146df5..d806adf 100644 --- a/datamodel.combodo-workflow-graphical-view.xml +++ b/datamodel.combodo-workflow-graphical-view.xml @@ -1,5 +1,5 @@ - + false diff --git a/module.combodo-workflow-graphical-view.php b/module.combodo-workflow-graphical-view.php index c069b5d..1704f6a 100644 --- a/module.combodo-workflow-graphical-view.php +++ b/module.combodo-workflow-graphical-view.php @@ -20,7 +20,7 @@ /** @noinspection PhpUnhandledExceptionInspection */ SetupWebPage::AddModule( __FILE__, // Path to the current file, all other file names are relative to the directory containing this file - 'combodo-workflow-graphical-view/1.1.1', + 'combodo-workflow-graphical-view/1.2.0', array( // Identification // @@ -29,7 +29,10 @@ // Setup // - 'dependencies' => array(), + 'dependencies' => array( + //optional dependance with the portal as it can be used in the back office only + 'itop-portal-base/3.2.0 || itop-structure/3.2.0', + ), 'mandatory' => false, 'visible' => true, diff --git a/src/Helper/LifecycleGraphHelper.php b/src/Helper/LifecycleGraphHelper.php index 6a72ac8..8ab5e99 100644 --- a/src/Helper/LifecycleGraphHelper.php +++ b/src/Helper/LifecycleGraphHelper.php @@ -31,11 +31,12 @@ */ class LifecycleGraphHelper { - public static function GetLifecycleGraph($sObjClass, $iObjID, $oObject, $sOutputFormat) + public static function GetLifecycleGraph($oObject, $sOutputFormat) { + $sObjClass = get_class($oObject); try { if (!LifecycleManager::IsEligibleObject($oObject)) { - throw new Exception(Dict::Format('workflow-graphical-view:Error:ObjectNotEligible', $sObjClass, $iObjID)); + throw new Exception(Dict::Format('workflow-graphical-view:Error:ObjectNotEligible', $sObjClass, $oObject->GetKey())); } // Get module parameters diff --git a/src/Portal/Controller/LifecycleBrickController.php b/src/Portal/Controller/LifecycleBrickController.php index ddd3f29..0bd70d3 100644 --- a/src/Portal/Controller/LifecycleBrickController.php +++ b/src/Portal/Controller/LifecycleBrickController.php @@ -9,55 +9,41 @@ use ApprovalScheme; use Combodo\iTop\Extension\WorkflowGraphicalView\Helper\LifecycleGraphHelper; -use Combodo\iTop\Portal\Controller\ObjectController; +use Combodo\iTop\Portal\Controller\AbstractController; +use Combodo\iTop\Portal\Helper\RequestManipulatorHelper; +use Combodo\iTop\Portal\Helper\SecurityHelper; +use Dict; use MetaModel; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use UserRights; -use utils; +use Symfony\Component\HttpKernel\Exception\HttpException; /** * Class ApprovalBrickController * * @package Combodo\iTop\Portal\Controller */ -class LifecycleBrickController extends ObjectController +class LifecycleBrickController extends AbstractController { - public function GetObject($sObjectClass, $sObjectId){ - $oObject = MetaModel::GetObject($sObjectClass, $sObjectId, false /* MustBeFound */, - $this->oScopeValidatorHelper->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjectClass)); - return $oObject; + public function __construct( + protected SecurityHelper $oSecurityHelper, + protected RequestManipulatorHelper $oRequestManipulatorHelper + ) + { } - /** - * @param \Symfony\Component\HttpFoundation\Request $oRequest - * - * @return \Symfony\Component\HttpFoundation\Response - * @throws \ArchivedObjectException - * @throws \Combodo\iTop\Portal\Brick\BrickNotFoundException - * @throws \CoreException - * @throws \CoreUnexpectedValue - * @throws \DictExceptionMissingString - * @throws \MySQLException - * @throws \OQLException - */ - public function ViewObjectLifecycleAction(Request $oRequest) + public function ViewObjectLifecycleAction(Request $oRequest): Response { - $sObjClass = utils::ReadParam('object_class', '', false, 'class'); - $iObjID = (int) utils::ReadParam('object_id', 0, false, 'integer'); - $sOutputFormat = utils::ReadParam('output_format', 'image'); - try - { - $oObject = MetaModel::GetObject($sObjClass, $iObjID, true, $this->oScopeValidatorHelper->IsAllDataAllowedForScope(UserRights::ListProfiles(), $sObjClass)); - [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($sObjClass, $iObjID, $oObject, $sOutputFormat); - return new Response($sContent, $sHttpResponseCode, $aHeaders); - } - catch(Exception $oException) - { - $aHeaders['Content-type'] = 'text/html'; - return new Response( "

{$oException->getMessage()}

",Response::HTTP_INTERNAL_SERVER_ERROR, $aHeaders); - } - } + $sObjClass = $this->oRequestManipulatorHelper->ReadParam('object_class', '', FILTER_SANITIZE_SPECIAL_CHARS); + $iObjID = (int) $this->oRequestManipulatorHelper->ReadParam('object_id', 0, FILTER_SANITIZE_NUMBER_INT); + $sOutputFormat = $this->oRequestManipulatorHelper->ReadParam('output_format', 'image', FILTER_SANITIZE_SPECIAL_CHARS); + if ($this->oSecurityHelper->IsActionAllowed(UR_ACTION_READ, $sObjClass, $iObjID) === false) { + throw new HttpException(Response::HTTP_NOT_FOUND, Dict::S('UI:ObjectDoesNotExist')); + } + $oObject = MetaModel::GetObject($sObjClass, $iObjID, true, true); + [$sContent, $sHttpResponseCode, $aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); + return new Response($sContent, $sHttpResponseCode, $aHeaders); + } } diff --git a/src/Portal/Router/LifecycleBrickRouter.php b/src/Portal/Router/LifecycleBrickRouter.php index e294322..5e1b0d3 100644 --- a/src/Portal/Router/LifecycleBrickRouter.php +++ b/src/Portal/Router/LifecycleBrickRouter.php @@ -22,28 +22,22 @@ use Combodo\iTop\Portal\Routing\ItopExtensionsExtraRoutes; -/** @noinspection PhpUnhandledExceptionInspection */ -ItopExtensionsExtraRoutes::AddRoutes( - array( - array('pattern' => '/lifecycle/view', - 'callback' => 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController::ViewObjectLifecycleAction', - 'bind' => 'p_lifecycle_view_object' - ), - ) -); - -/** - * @since 3.1.0 - */ -//remove require itopdesignformat at the same time as version_compare(ITOP_DESIGN_LATEST_VERSION , '3.0') < 0 -if (! defined("ITOP_DESIGN_LATEST_VERSION")) { - require_once APPROOT.'setup/itopdesignformat.class.inc.php'; -} -if (version_compare(ITOP_DESIGN_LATEST_VERSION, 3.1, '>=')) { - /** @noinspection PhpUnhandledExceptionInspection */ - ItopExtensionsExtraRoutes::AddControllersClasses( - array( - 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController' - ) - ); +// protection if portal module is not installed +if (class_exists("Combodo\\iTop\\Portal\\Routing\\ItopExtensionsExtraRoutes")) { + /** @noinspection PhpUnhandledExceptionInspection */ + ItopExtensionsExtraRoutes::AddControllersClasses( + [ + 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController' + ] + ); + /** @noinspection PhpUnhandledExceptionInspection */ + ItopExtensionsExtraRoutes::AddRoutes( + [ + [ + 'pattern' => '/lifecycle/view', + 'callback' => 'Combodo\\iTop\\Extension\\WorkflowGraphicalView\\Portal\\Controller\\LifecycleBrickController::ViewObjectLifecycleAction', + 'bind' => 'p_lifecycle_view_object' + ], + ] + ); } \ No newline at end of file From c56527f68626c474e04970cc65dd14fd2a836bdc Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 4 Sep 2024 13:30:06 +0200 Subject: [PATCH 09/15] Apply suggestions from code review --- ajax-operations.php | 2 +- src/Portal/Controller/LifecycleBrickController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ajax-operations.php b/ajax-operations.php index 86145f2..36f9551 100644 --- a/ajax-operations.php +++ b/ajax-operations.php @@ -43,7 +43,7 @@ { // Retrieve object $oObject = MetaModel::GetObject($sObjClass, $iObjID); - [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); + [$sContent, $sHttpResponseCode, $aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); header('Content-type: '.$aHeaders['Content-type']); echo $sContent; diff --git a/src/Portal/Controller/LifecycleBrickController.php b/src/Portal/Controller/LifecycleBrickController.php index 0bd70d3..d6d07d0 100644 --- a/src/Portal/Controller/LifecycleBrickController.php +++ b/src/Portal/Controller/LifecycleBrickController.php @@ -43,7 +43,7 @@ public function ViewObjectLifecycleAction(Request $oRequest): Response } $oObject = MetaModel::GetObject($sObjClass, $iObjID, true, true); - [$sContent, $sHttpResponseCode, $aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); + [$sContent, $sHttpResponseCode, $aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); return new Response($sContent, $sHttpResponseCode, $aHeaders); } } From 6aa5209eda55ed79de933b2a53e39085ca4a2afb Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 6 May 2024 18:34:40 +0200 Subject: [PATCH 10/15] :memo: Copyright year bump --- ajax-operations.php | 2 +- asset/css/default.scss | 2 +- asset/js/workflow_graphical_view.js | 2 +- asset/js/workflow_graphical_view_backoffice.js | 2 +- asset/js/workflow_graphical_view_portal.js | 2 +- cs.dict.combodo-workflow-graphical-view.php | 2 +- da.dict.combodo-workflow-graphical-view.php | 2 +- de.dict.combodo-workflow-graphical-view.php | 2 +- en.dict.combodo-workflow-graphical-view.php | 2 +- es_cr.dict.combodo-workflow-graphical-view.php | 2 +- hu.dict.combodo-workflow-graphical-view.php | 2 +- it.dict.combodo-workflow-graphical-view.php | 2 +- ja.dict.combodo-workflow-graphical-view.php | 2 +- module.combodo-workflow-graphical-view.php | 2 +- nl.dict.combodo-workflow-graphical-view.php | 2 +- pl.dict.combodo-workflow-graphical-view.php | 2 +- pt_br.dict.combodo-workflow-graphical-view.php | 2 +- ru.dict.combodo-workflow-graphical-view.php | 2 +- sk.dict.combodo-workflow-graphical-view.php | 2 +- src/Helper/ConfigHelper.php | 2 +- src/Hook/ConsoleUIExtension.php | 2 +- src/Hook/PortalUIExtension.php | 2 +- src/Service/GraphvizGenerator.php | 2 +- src/Service/LifecycleManager.php | 2 +- tr.dict.combodo-workflow-graphical-view.php | 2 +- zh_cn.dict.combodo-workflow-graphical-view.php | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ajax-operations.php b/ajax-operations.php index 36f9551..ab9df11 100644 --- a/ajax-operations.php +++ b/ajax-operations.php @@ -1,6 +1,6 @@ Date: Tue, 11 Jun 2024 16:59:00 +0200 Subject: [PATCH 11/15] Automated dictionaries synchronization with english reference --- cs.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- da.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- de.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- ...r.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- fr.dict.combodo-workflow-graphical-view.php | 18 ++++++++----- hu.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- it.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- ja.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- nl.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- pl.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- ...r.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- ru.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- sk.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- tr.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- ...n.dict.combodo-workflow-graphical-view.php | 27 ++++++++----------- 15 files changed, 166 insertions(+), 230 deletions(-) diff --git a/cs.dict.combodo-workflow-graphical-view.php b/cs.dict.combodo-workflow-graphical-view.php index 518b161..51ca4b5 100644 --- a/cs.dict.combodo-workflow-graphical-view.php +++ b/cs.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/da.dict.combodo-workflow-graphical-view.php b/da.dict.combodo-workflow-graphical-view.php index 6fd9034..e47c496 100644 --- a/da.dict.combodo-workflow-graphical-view.php +++ b/da.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/de.dict.combodo-workflow-graphical-view.php b/de.dict.combodo-workflow-graphical-view.php index 45f33c4..f60c9e9 100644 --- a/de.dict.combodo-workflow-graphical-view.php +++ b/de.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Hoppla! Der Lebenszyklus konnte nicht erstellt werden. Überprüfen Sie das Error-Log für weitere Informationen.', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Es kann kein Lebenszyklusdiagramm für %1$s erstellt werden, da es kein Statusattribut hat.', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Ablauf anzeigen', - 'workflow-graphical-view:UI:Modal:Title' => 'Ablauf', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Aktueller Status', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'Benutzer-Statusübergänge', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Interne Statusübergänge', 'workflow-graphical-view:Error:NoStateAttribute' => 'Es kann kein Lebenszyklusdiagramm für %1$s erstellt werden, da es kein Statusattribut hat.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Hoppla! Der Lebenszyklus konnte nicht erstellt werden. Überprüfen Sie das Error-Log für weitere Informationen.', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'Benutzer-Statusübergänge', + 'workflow-graphical-view:UI:Modal:Title' => 'Ablauf', +]); diff --git a/es_cr.dict.combodo-workflow-graphical-view.php b/es_cr.dict.combodo-workflow-graphical-view.php index 6ab71f9..f568a25 100644 --- a/es_cr.dict.combodo-workflow-graphical-view.php +++ b/es_cr.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/fr.dict.combodo-workflow-graphical-view.php b/fr.dict.combodo-workflow-graphical-view.php index 85e50b8..6b84819 100644 --- a/fr.dict.combodo-workflow-graphical-view.php +++ b/fr.dict.combodo-workflow-graphical-view.php @@ -2,16 +2,22 @@ /** * Localized data * - * @copyright Copyright (C) 2013 XXXXX - * @license http://opensource.org/licenses/AGPL-3.0 + * @copyright Copyright (C) 2010-2024 Combodo SAS + * @license https://opensource.org/licenses/AGPL-3.0 + * */ -Dict::Add('FR FR', 'French', 'Français', array( +/** + * + */ +Dict::Add('FR FR', 'French', 'Français', [ + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Oups ! Le cycle de vie n\'a pas pu être chargé, vérifiez le journal des erreurs pour plus d\'informations.', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Impossible de générer le graphique du cycle de vie pour %1$s car la classe n\'a pas d\'attribut portant le cycle de vie.', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Voir le cycle de vie', - 'workflow-graphical-view:UI:Modal:Title' => 'Cycle de vie', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'État courant', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'Transitions utilisateurs', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Transitions internes', 'workflow-graphical-view:Error:NoStateAttribute' => 'Impossible de générer le graphique du cycle de vie pour %1$s car la classe n\'a pas d\'attribut portant le cycle de vie.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Oups ! Le cycle de vie n\'a pas pu être chargé, vérifiez le journal des erreurs pour plus d\'informations.', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Impossible d\'afficher le cycle de vie pour l\'objet %1$s#%2$s, il n\'est pas disponible.', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'Transitions utilisateurs', + 'workflow-graphical-view:UI:Modal:Title' => 'Cycle de vie', +]); diff --git a/hu.dict.combodo-workflow-graphical-view.php b/hu.dict.combodo-workflow-graphical-view.php index 37f92ef..be0da65 100644 --- a/hu.dict.combodo-workflow-graphical-view.php +++ b/hu.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/it.dict.combodo-workflow-graphical-view.php b/it.dict.combodo-workflow-graphical-view.php index 34841fe..f715442 100644 --- a/it.dict.combodo-workflow-graphical-view.php +++ b/it.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/ja.dict.combodo-workflow-graphical-view.php b/ja.dict.combodo-workflow-graphical-view.php index fc90a3f..d0407de 100644 --- a/ja.dict.combodo-workflow-graphical-view.php +++ b/ja.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/nl.dict.combodo-workflow-graphical-view.php b/nl.dict.combodo-workflow-graphical-view.php index 1f15bb2..4516d6c 100644 --- a/nl.dict.combodo-workflow-graphical-view.php +++ b/nl.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/pl.dict.combodo-workflow-graphical-view.php b/pl.dict.combodo-workflow-graphical-view.php index 122107a..f2e68a5 100644 --- a/pl.dict.combodo-workflow-graphical-view.php +++ b/pl.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/pt_br.dict.combodo-workflow-graphical-view.php b/pt_br.dict.combodo-workflow-graphical-view.php index 1a9d631..753b199 100644 --- a/pt_br.dict.combodo-workflow-graphical-view.php +++ b/pt_br.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/ru.dict.combodo-workflow-graphical-view.php b/ru.dict.combodo-workflow-graphical-view.php index b4e52c1..9f6acbf 100644 --- a/ru.dict.combodo-workflow-graphical-view.php +++ b/ru.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/sk.dict.combodo-workflow-graphical-view.php b/sk.dict.combodo-workflow-graphical-view.php index eec14f0..9a217f0 100644 --- a/sk.dict.combodo-workflow-graphical-view.php +++ b/sk.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/tr.dict.combodo-workflow-graphical-view.php b/tr.dict.combodo-workflow-graphical-view.php index b4f4bd3..0d1be2a 100644 --- a/tr.dict.combodo-workflow-graphical-view.php +++ b/tr.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); diff --git a/zh_cn.dict.combodo-workflow-graphical-view.php b/zh_cn.dict.combodo-workflow-graphical-view.php index 045de9e..6f5180e 100644 --- a/zh_cn.dict.combodo-workflow-graphical-view.php +++ b/zh_cn.dict.combodo-workflow-graphical-view.php @@ -1,28 +1,23 @@ 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow~~', - 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state~~', - 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Legend:Item:InternalStimuli' => 'Internal stimuli~~', 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); + 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', + 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', +]); From 765947e2ff5bff1828d20379d1b0466ddc5c7184 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 1 Mar 2024 10:28:49 +0100 Subject: [PATCH 12/15] refactor + add dictionary entries --- ajax-operations.php | 6 ++++-- cs.dict.combodo-workflow-graphical-view.php | 5 ++++- da.dict.combodo-workflow-graphical-view.php | 5 ++++- de.dict.combodo-workflow-graphical-view.php | 5 ++++- es_cr.dict.combodo-workflow-graphical-view.php | 5 ++++- fr.dict.combodo-workflow-graphical-view.php | 5 ++++- hu.dict.combodo-workflow-graphical-view.php | 5 ++++- it.dict.combodo-workflow-graphical-view.php | 5 ++++- ja.dict.combodo-workflow-graphical-view.php | 5 ++++- module.combodo-workflow-graphical-view.php | 1 + nl.dict.combodo-workflow-graphical-view.php | 5 ++++- pl.dict.combodo-workflow-graphical-view.php | 5 ++++- pt_br.dict.combodo-workflow-graphical-view.php | 5 ++++- ru.dict.combodo-workflow-graphical-view.php | 5 ++++- sk.dict.combodo-workflow-graphical-view.php | 5 ++++- tr.dict.combodo-workflow-graphical-view.php | 5 ++++- zh_cn.dict.combodo-workflow-graphical-view.php | 5 ++++- 17 files changed, 65 insertions(+), 17 deletions(-) diff --git a/ajax-operations.php b/ajax-operations.php index ab9df11..42e5603 100644 --- a/ajax-operations.php +++ b/ajax-operations.php @@ -23,6 +23,7 @@ use Exception; use LoginWebPage; use MetaModel; +use Symfony\Component\HttpFoundation\Response; use utils; // Note: approot.inc.php is relative to /pages/exc.php, so calls to this page must be done through it! @@ -43,15 +44,16 @@ { // Retrieve object $oObject = MetaModel::GetObject($sObjClass, $iObjID); - [$sContent, $sHttpResponseCode, $aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); + [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($sObjClass, $iObjID, $oObject, $sOutputFormat); + //http_response_code($sHttpResponseCode); header('Content-type: '.$aHeaders['Content-type']); echo $sContent; } catch(Exception $oException) { - http_response_code(500); + http_response_code(Response::HTTP_INTERNAL_SERVER_ERROR); header('Content-type: text/html'); echo "

{$oException->getMessage()}

"; } \ No newline at end of file diff --git a/cs.dict.combodo-workflow-graphical-view.php b/cs.dict.combodo-workflow-graphical-view.php index 51ca4b5..9fdeefd 100644 --- a/cs.dict.combodo-workflow-graphical-view.php +++ b/cs.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/da.dict.combodo-workflow-graphical-view.php b/da.dict.combodo-workflow-graphical-view.php index e47c496..882138a 100644 --- a/da.dict.combodo-workflow-graphical-view.php +++ b/da.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/de.dict.combodo-workflow-graphical-view.php b/de.dict.combodo-workflow-graphical-view.php index f60c9e9..51c5e6e 100644 --- a/de.dict.combodo-workflow-graphical-view.php +++ b/de.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'Benutzer-Statusübergänge', 'workflow-graphical-view:UI:Modal:Title' => 'Ablauf', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Es kann kein Lebenszyklusdiagramm für %1$s erstellt werden, da es kein Statusattribut hat.', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Hoppla! Der Lebenszyklus konnte nicht erstellt werden. Überprüfen Sie das Error-Log für weitere Informationen.', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/es_cr.dict.combodo-workflow-graphical-view.php b/es_cr.dict.combodo-workflow-graphical-view.php index f568a25..b63cb0a 100644 --- a/es_cr.dict.combodo-workflow-graphical-view.php +++ b/es_cr.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/fr.dict.combodo-workflow-graphical-view.php b/fr.dict.combodo-workflow-graphical-view.php index 6b84819..ac7265a 100644 --- a/fr.dict.combodo-workflow-graphical-view.php +++ b/fr.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Impossible d\'afficher le cycle de vie pour l\'objet %1$s#%2$s, il n\'est pas disponible.', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'Transitions utilisateurs', 'workflow-graphical-view:UI:Modal:Title' => 'Cycle de vie', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Impossible de générer le graphique du cycle de vie pour %1$s car la classe n\'a pas d\'attribut portant le cycle de vie.', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Oups ! Le cycle de vie n\'a pas pu être chargé, vérifiez le journal des erreurs pour plus d\'informations.', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Impossible d\'afficher le cycle de vie pour l\'objet %1$s#%2$s, il n\'est pas disponible.', +)); diff --git a/hu.dict.combodo-workflow-graphical-view.php b/hu.dict.combodo-workflow-graphical-view.php index be0da65..a9d46f5 100644 --- a/hu.dict.combodo-workflow-graphical-view.php +++ b/hu.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/it.dict.combodo-workflow-graphical-view.php b/it.dict.combodo-workflow-graphical-view.php index f715442..372f355 100644 --- a/it.dict.combodo-workflow-graphical-view.php +++ b/it.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/ja.dict.combodo-workflow-graphical-view.php b/ja.dict.combodo-workflow-graphical-view.php index d0407de..8a99223 100644 --- a/ja.dict.combodo-workflow-graphical-view.php +++ b/ja.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/module.combodo-workflow-graphical-view.php b/module.combodo-workflow-graphical-view.php index 9feaef9..4fa9b27 100644 --- a/module.combodo-workflow-graphical-view.php +++ b/module.combodo-workflow-graphical-view.php @@ -41,6 +41,7 @@ 'datamodel' => array( // Module's autoloader 'vendor/autoload.php', + 'src/Portal/Controller/LifecycleBrickController.php', // Explicitly load APIs classes 'src/Portal/Router/LifecycleBrickRouter.php', 'src/Hook/ConsoleUIExtension.php', diff --git a/nl.dict.combodo-workflow-graphical-view.php b/nl.dict.combodo-workflow-graphical-view.php index 4516d6c..60b406e 100644 --- a/nl.dict.combodo-workflow-graphical-view.php +++ b/nl.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/pl.dict.combodo-workflow-graphical-view.php b/pl.dict.combodo-workflow-graphical-view.php index f2e68a5..9abe037 100644 --- a/pl.dict.combodo-workflow-graphical-view.php +++ b/pl.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/pt_br.dict.combodo-workflow-graphical-view.php b/pt_br.dict.combodo-workflow-graphical-view.php index 753b199..09be32a 100644 --- a/pt_br.dict.combodo-workflow-graphical-view.php +++ b/pt_br.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/ru.dict.combodo-workflow-graphical-view.php b/ru.dict.combodo-workflow-graphical-view.php index 9f6acbf..19cb86b 100644 --- a/ru.dict.combodo-workflow-graphical-view.php +++ b/ru.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/sk.dict.combodo-workflow-graphical-view.php b/sk.dict.combodo-workflow-graphical-view.php index 9a217f0..6474ea6 100644 --- a/sk.dict.combodo-workflow-graphical-view.php +++ b/sk.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/tr.dict.combodo-workflow-graphical-view.php b/tr.dict.combodo-workflow-graphical-view.php index 0d1be2a..3d739e2 100644 --- a/tr.dict.combodo-workflow-graphical-view.php +++ b/tr.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); diff --git a/zh_cn.dict.combodo-workflow-graphical-view.php b/zh_cn.dict.combodo-workflow-graphical-view.php index 6f5180e..ab0835e 100644 --- a/zh_cn.dict.combodo-workflow-graphical-view.php +++ b/zh_cn.dict.combodo-workflow-graphical-view.php @@ -20,4 +20,7 @@ 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', 'workflow-graphical-view:UI:Legend:Item:UserStimuli' => 'User stimuli~~', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow~~', -]); + 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', + 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', + 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', +)); From f371e98ce7ece8f4d2d1f36ceac4ae7a65462515 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Wed, 4 Sep 2024 11:46:38 +0200 Subject: [PATCH 13/15] Change made in PR review --- ajax-operations.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ajax-operations.php b/ajax-operations.php index 42e5603..489cc1d 100644 --- a/ajax-operations.php +++ b/ajax-operations.php @@ -44,9 +44,8 @@ { // Retrieve object $oObject = MetaModel::GetObject($sObjClass, $iObjID); - [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($sObjClass, $iObjID, $oObject, $sOutputFormat); + [ $sContent, $sHttpResponseCode,$aHeaders] = LifecycleGraphHelper::GetLifecycleGraph($oObject, $sOutputFormat); - //http_response_code($sHttpResponseCode); header('Content-type: '.$aHeaders['Content-type']); echo $sContent; From 99122e33c30547cfa82972a51580dca2f28270e6 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Fri, 25 Oct 2024 17:32:11 +0200 Subject: [PATCH 14/15] Fix errors after rebase on master --- cs.dict.combodo-workflow-graphical-view.php | 2 +- da.dict.combodo-workflow-graphical-view.php | 2 +- de.dict.combodo-workflow-graphical-view.php | 2 +- en.dict.combodo-workflow-graphical-view.php | 4 ++-- es_cr.dict.combodo-workflow-graphical-view.php | 2 +- fr.dict.combodo-workflow-graphical-view.php | 2 +- hu.dict.combodo-workflow-graphical-view.php | 2 +- it.dict.combodo-workflow-graphical-view.php | 2 +- ja.dict.combodo-workflow-graphical-view.php | 2 +- nl.dict.combodo-workflow-graphical-view.php | 2 +- pl.dict.combodo-workflow-graphical-view.php | 2 +- pt_br.dict.combodo-workflow-graphical-view.php | 2 +- ru.dict.combodo-workflow-graphical-view.php | 2 +- sk.dict.combodo-workflow-graphical-view.php | 2 +- tr.dict.combodo-workflow-graphical-view.php | 2 +- zh_cn.dict.combodo-workflow-graphical-view.php | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cs.dict.combodo-workflow-graphical-view.php b/cs.dict.combodo-workflow-graphical-view.php index 9fdeefd..2d46930 100644 --- a/cs.dict.combodo-workflow-graphical-view.php +++ b/cs.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/da.dict.combodo-workflow-graphical-view.php b/da.dict.combodo-workflow-graphical-view.php index 882138a..85b17a8 100644 --- a/da.dict.combodo-workflow-graphical-view.php +++ b/da.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/de.dict.combodo-workflow-graphical-view.php b/de.dict.combodo-workflow-graphical-view.php index 51c5e6e..f1ecb17 100644 --- a/de.dict.combodo-workflow-graphical-view.php +++ b/de.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Es kann kein Lebenszyklusdiagramm für %1$s erstellt werden, da es kein Statusattribut hat.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Hoppla! Der Lebenszyklus konnte nicht erstellt werden. Überprüfen Sie das Error-Log für weitere Informationen.', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/en.dict.combodo-workflow-graphical-view.php b/en.dict.combodo-workflow-graphical-view.php index 9177183..77d432f 100644 --- a/en.dict.combodo-workflow-graphical-view.php +++ b/en.dict.combodo-workflow-graphical-view.php @@ -17,7 +17,7 @@ * You should have received a copy of the GNU Affero General Public License */ -Dict::Add('EN US', 'English', 'English', array( +Dict::Add('EN US', 'English', 'English',[ 'workflow-graphical-view:UI:Button:ShowLifecycle' => 'Show workflow', 'workflow-graphical-view:UI:Modal:Title' => 'Workflow', 'workflow-graphical-view:UI:Legend:Item:CurrentState' => 'Current state', @@ -26,4 +26,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible', -)); +]); diff --git a/es_cr.dict.combodo-workflow-graphical-view.php b/es_cr.dict.combodo-workflow-graphical-view.php index b63cb0a..124ea08 100644 --- a/es_cr.dict.combodo-workflow-graphical-view.php +++ b/es_cr.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); \ No newline at end of file diff --git a/fr.dict.combodo-workflow-graphical-view.php b/fr.dict.combodo-workflow-graphical-view.php index ac7265a..d8eb3cb 100644 --- a/fr.dict.combodo-workflow-graphical-view.php +++ b/fr.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Impossible de générer le graphique du cycle de vie pour %1$s car la classe n\'a pas d\'attribut portant le cycle de vie.', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Oups ! Le cycle de vie n\'a pas pu être chargé, vérifiez le journal des erreurs pour plus d\'informations.', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Impossible d\'afficher le cycle de vie pour l\'objet %1$s#%2$s, il n\'est pas disponible.', -)); +]); diff --git a/hu.dict.combodo-workflow-graphical-view.php b/hu.dict.combodo-workflow-graphical-view.php index a9d46f5..bffc24e 100644 --- a/hu.dict.combodo-workflow-graphical-view.php +++ b/hu.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/it.dict.combodo-workflow-graphical-view.php b/it.dict.combodo-workflow-graphical-view.php index 372f355..e6f3df5 100644 --- a/it.dict.combodo-workflow-graphical-view.php +++ b/it.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/ja.dict.combodo-workflow-graphical-view.php b/ja.dict.combodo-workflow-graphical-view.php index 8a99223..7cc0478 100644 --- a/ja.dict.combodo-workflow-graphical-view.php +++ b/ja.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/nl.dict.combodo-workflow-graphical-view.php b/nl.dict.combodo-workflow-graphical-view.php index 60b406e..40fc85f 100644 --- a/nl.dict.combodo-workflow-graphical-view.php +++ b/nl.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/pl.dict.combodo-workflow-graphical-view.php b/pl.dict.combodo-workflow-graphical-view.php index 9abe037..c0f9800 100644 --- a/pl.dict.combodo-workflow-graphical-view.php +++ b/pl.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/pt_br.dict.combodo-workflow-graphical-view.php b/pt_br.dict.combodo-workflow-graphical-view.php index 09be32a..ed00b45 100644 --- a/pt_br.dict.combodo-workflow-graphical-view.php +++ b/pt_br.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/ru.dict.combodo-workflow-graphical-view.php b/ru.dict.combodo-workflow-graphical-view.php index 19cb86b..2c5e570 100644 --- a/ru.dict.combodo-workflow-graphical-view.php +++ b/ru.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/sk.dict.combodo-workflow-graphical-view.php b/sk.dict.combodo-workflow-graphical-view.php index 6474ea6..f6f5259 100644 --- a/sk.dict.combodo-workflow-graphical-view.php +++ b/sk.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/tr.dict.combodo-workflow-graphical-view.php b/tr.dict.combodo-workflow-graphical-view.php index 3d739e2..c480487 100644 --- a/tr.dict.combodo-workflow-graphical-view.php +++ b/tr.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); diff --git a/zh_cn.dict.combodo-workflow-graphical-view.php b/zh_cn.dict.combodo-workflow-graphical-view.php index ab0835e..b7c8342 100644 --- a/zh_cn.dict.combodo-workflow-graphical-view.php +++ b/zh_cn.dict.combodo-workflow-graphical-view.php @@ -23,4 +23,4 @@ 'workflow-graphical-view:Error:NoStateAttribute' => 'Cannot generate lifecycle graph for %1$s as it has no state attribute.~~', 'workflow-graphical-view:Error:GraphVizGeneration' => 'Whoops! Lifecycle could not be generated, check the error log for more information.~~', 'workflow-graphical-view:Error:ObjectNotEligible' => 'Cannot show lifecycle for %1$s#%2$s, object is not eligible~~', -)); +]); From b9f8fa6ef6269ee3c3d4ff67f236e6343e2c78a4 Mon Sep 17 00:00:00 2001 From: Anne-Cath Date: Tue, 5 Nov 2024 08:46:58 +0100 Subject: [PATCH 15/15] remove old code for iTop < 3.2 --- src/Hook/ConsoleUIExtension.php | 28 ++++---------------- src/Service/LifecycleManager.php | 44 ++++++++------------------------ 2 files changed, 15 insertions(+), 57 deletions(-) diff --git a/src/Hook/ConsoleUIExtension.php b/src/Hook/ConsoleUIExtension.php index b30a7de..a614414 100644 --- a/src/Hook/ConsoleUIExtension.php +++ b/src/Hook/ConsoleUIExtension.php @@ -54,30 +54,12 @@ public function OnDisplayProperties($oObject, WebPage $oPage, $bEditMode = false $aJSFiles = $oLM->GetJSFilesUrls(); $sJSWidgetSnippet = $oLM->GetJSWidgetSnippetForObjectDetails(); - /** - * @since 3.2.0 - */ - //remove require itopdesignformat at the same time as version_compare(ITOP_DESIGN_LATEST_VERSION , '3.2') < 0 - if (!defined("ITOP_DESIGN_LATEST_VERSION")) { - require_once APPROOT.'setup/itopdesignformat.class.inc.php'; + // Add resources + foreach ($aCSSFiles as $sCSSFile) { + $oPage->LinkStylesheetFromURI($sCSSFile); } - if (version_compare(ITOP_DESIGN_LATEST_VERSION, 3.2, '>=')) { - // Add resources - foreach ($aCSSFiles as $sCSSFile) { - $oPage->LinkStylesheetFromURI($sCSSFile); - } - foreach ($aJSFiles as $sJSFile) { - $oPage->LinkScriptFromURI($sJSFile); - } - } else - { - // Add resources - foreach ($aCSSFiles as $sCSSFile) { - $oPage->add_linked_stylesheet($sCSSFile); - } - foreach ($aJSFiles as $sJSFile) { - $oPage->add_linked_script($sJSFile); - } + foreach ($aJSFiles as $sJSFile) { + $oPage->LinkScriptFromURI($sJSFile); } // Add script diff --git a/src/Service/LifecycleManager.php b/src/Service/LifecycleManager.php index 67c05e5..eeb3afb 100644 --- a/src/Service/LifecycleManager.php +++ b/src/Service/LifecycleManager.php @@ -51,16 +51,7 @@ public static function IsEligibleObject(DBObject $oObject) return false; } - // Check if has state attribute - if (version_compare(ITOP_DESIGN_LATEST_VERSION , '3.0') < 0) { - $sStateAttCode = MetaModel::GetStateAttributeCode($sClass); - if (empty($sStateAttCode)) - { - return false; - } - } else { - return MetaModel::HasLifecycle($sClass); - } + return MetaModel::HasLifecycle($sClass); return true; } @@ -75,32 +66,17 @@ public static function EnumEligibleClasses() { // Check if has state attribute $aEligibleClasses = array(); - if (version_compare(ITOP_DESIGN_LATEST_VERSION , '3.0') < 0) { - foreach (MetaModel::EnumRootClasses() as $sRootClass) { - $sStateAttCode = MetaModel::GetStateAttributeCode($sRootClass); - if (!empty($sStateAttCode)) { - $aEligibleClasses[$sRootClass] = array('state_att_code' => $sStateAttCode); - } - foreach (MetaModel::EnumChildClasses($sRootClass) as $sChildClass) { - $sStateAttCode = MetaModel::GetStateAttributeCode($sChildClass); - if (!empty($sStateAttCode)) { - $aEligibleClasses[$sChildClass] = array('state_att_code' => $sStateAttCode); - } - } + foreach (MetaModel::EnumRootClasses() as $sRootClass) { + $sStateAttCode = MetaModel::GetStateAttributeCode($sRootClass); + if (MetaModel::HasLifecycle($sRootClass)) { + $aEligibleClasses[$sRootClass] = array('state_att_code' => $sStateAttCode); } - } else { - foreach (MetaModel::EnumRootClasses() as $sRootClass) { - $sStateAttCode = MetaModel::GetStateAttributeCode($sRootClass); - if (MetaModel::HasLifecycle($sRootClass)) { - $aEligibleClasses[$sRootClass] = array('state_att_code' => $sStateAttCode); - } - foreach (MetaModel::EnumChildClasses($sRootClass) as $sChildClass) { - $sStateAttCode = MetaModel::GetStateAttributeCode($sChildClass); - if (MetaModel::HasLifecycle($sChildClass)) { - $aEligibleClasses[$sChildClass] = array('state_att_code' => $sStateAttCode); - } + foreach (MetaModel::EnumChildClasses($sRootClass) as $sChildClass) { + $sStateAttCode = MetaModel::GetStateAttributeCode($sChildClass); + if (MetaModel::HasLifecycle($sChildClass)) { + $aEligibleClasses[$sChildClass] = array('state_att_code' => $sStateAttCode); } } } @@ -232,7 +208,7 @@ public function GetJSWidgetSnippetForObjectDetails() $sDictEntryModalTitleAsJSON = json_encode(Dict::S('workflow-graphical-view:UI:Modal:Title')); $sDictEntryModalCloseLabelAsJSON = json_encode(Dict::S('UI:Button:Close')); - $sAttributeSelectorPrefix = (version_compare(ITOP_DESIGN_LATEST_VERSION , '3.0', '>=') && ContextTag::Check(ContextTag::TAG_CONSOLE)) ? '.ibo-object-details' : '.object-details'; + $sAttributeSelectorPrefix = ContextTag::Check(ContextTag::TAG_CONSOLE) ? '.ibo-object-details' : '.object-details'; return <<